Skip to content

solidnerd/docker-exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

docker-exporter

This repo is inspired from a slack post from bvis in the docker community slack how to export dynamically your engine metrics.

Why does it work ?

The clue is that you export docker_gwbridgeinterface in the swarm cluster. and there is the engine accessible

Setup a machine

For example do this for 3 nodes

docker-machine create --driver xhyve \
--xhyve-boot2docker-url=https://github.com/boot2docker/boot2docker/releases/download/v1.13.0-rc4/boot2docker.iso \
node01

Determine docker_gwbridge ip address

ip -o -4 addr show docker_gwbridge | awk -F '[ /]+' '/global/ {print $4}'

In my case it was 172.18.0.1 .

Enable Metrics on your engine

cat > /etc/docker/daemon.json <<EOF
{
  "experimental":true,
  "metrics-addr":"0.0.0.0:5050"
}
EOF

After you did this restart or reload your engine .

Setup your Terminal

Terminal 1:

eval $(dm env node01)

Terminal 2:

eval $(dm env node02)

Terminal 3:

eval $(dm env node03)

Lets build our services

docker build -t solidnerd/prometheus-docker-exporter prometheus
docker build -t solidnerd/socat socat

Push them to a registry

This step depends on you

Create you network and monitoring infrastructure

Create your monitoring network.

docker network create -d overylay monitoring

So expose your engine metrics in the swarm cluster.

docker \
  service create \
  --mode global \
  --name docker-exporter \
  --network monitoring \
  --env IN="172.18.0.1:5050" \
  --env OUT="5050" \
  --publish 5051:5050 \
  solidnerd/socat

Start your prometheus engine.

docker service create \
  --name prometheus \
  --network monitoring \
  --publish 9090:9090 \
  --constraint 'node.hostname==node01' \
solidnerd/prometheus-docker-exporter

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published