Giter Club home page Giter Club logo

dockerd-exporter's Introduction


Docker Image

Prometheus Docker daemon metrics exporter

Docker Engine

Create or edit /etc/systemd/system/docker.service.d/docker.conf, enable the experimental feature and set the metrics address to

ExecStart=/usr/bin/dockerd -H fd:// \
  --storage-driver=overlay2 \
  --dns --dns \
  --log-driver json-file \
  --log-opt max-size=50m --log-opt max-file=10 \
  --experimental=true \

Check if the docker_gwbridge ip address is

 docker run --rm --net host alpine ip -o addr show docker_gwbridge

Docker Swarm

Create an overlay network:

docker network create \
  --driver overlay \

Create dockerd-exporter global service (replace with your docker_gwbridge address):

docker service create -d \
  --mode global \
  --name dockerd-exporter \
  --network netmon \
  -e IN="" \
  -e OUT="9323" \

Configure Prometheus to scrape the dockerd-exporter instances:

- job_name: 'dockerd-exporter'
  - names:
    - 'tasks.dockerd-exporter'
    type: 'A'
    port: 9323

Run Prometheus on the same overlay network as dockerd-exporter.

dockerd-exporter's People


stefanprodan avatar SvenDowideit avatar


justthefracts avatar Batuhan Apaydın avatar James Mills avatar LoreLLo avatar  avatar gbChoi avatar Arbal avatar Andrea avatar Mark avatar Richard Metzler avatar John Belisle avatar Gilad Bar Orion avatar Igor Zubkov avatar  avatar Christopher Noel avatar Rostyslav Gulka avatar  avatar


James Cloos avatar Stefan Prodan avatar ZeFerby avatar

dockerd-exporter's Issues

connection just hangs

Hi I am trying to follow this approach but the connection just hangs.

I started investigating, and I am not able to query the metrics from inside the any container. Outside the container it works fine. I have tried with docker0 and docker_gwbridge.

Here is one example with docker0


  "experimental" : true,
  "bip": "",
  "metrics-addr" : ""

run test container in shared network

docker network create curlme
docker run --name socat --rm --network curlme alpine/socat -d -d TCP-L:4998,fork TCP:
docker run --rm --network curlme curlimages/curl -I socat:4998/metrics
2021/04/02 22:25:39 socat[1] W ioctl(5, IOCTL_VM_SOCKETS_GET_LOCAL_CID, ...): Not a tty
2021/04/02 22:25:39 socat[1] N listening on AF=2
2021/04/02 22:27:02 socat[1] N accepting connection from AF=2 on AF=2
2021/04/02 22:27:02 socat[1] N forked off child process 9
2021/04/02 22:27:02 socat[1] N listening on AF=2
2021/04/02 22:27:02 socat[9] N opening connection to AF=2
2021/04/02 22:29:12 socat[9] E connect(5, AF=2, 16): Operation timed out
2021/04/02 22:29:12 socat[9] N exit(1)
2021/04/02 22:29:12 socat[1] N childdied(): handling signal 17

When I do the same with docker swarm and 2 nodes, it hangs as well. In that case I am using the address of the docker_gwbrige. I create the bridge myself with fixed CIDR before joining the swarm.

docker network create \
--subnet \
--opt \
--opt \
--opt \

Then In the compose file for the stack deployment I run the image like so

    image: alpine/socat
      - monitoring
    command: -d -d TCP-L:4999,fork TCP:
      mode: global

And in Prometheus config

  - job_name: 'dockerd-exporter'
    - names: [ tasks.dockerd-exporter ]
      port: 4999
      type: A

But Prometheus also gets timeout error for these targets. They are discovered, but metrics request times out.

Can you please give me a hint why this isn't working?

This is the full project I am working on

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.