Made with Material for MkDocs
stefanprodan / dockerd-exporter Goto Github PK
View Code? Open in Web Editor NEWPrometheus Docker daemon metrics exporter
License: MIT License
Prometheus Docker daemon metrics exporter
License: MIT License
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
daemon.json
{
"experimental" : true,
"bip": "172.17.0.1/16",
"metrics-addr" : "0.0.0.0:4999"
}
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:172.17.0.1:4999
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 0.0.0.0:4998
2021/04/02 22:27:02 socat[1] N accepting connection from AF=2 172.19.0.3:41258 on AF=2 172.19.0.2:4998
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 0.0.0.0:4998
2021/04/02 22:27:02 socat[9] N opening connection to AF=2 172.17.0.1:4999
2021/04/02 22:29:12 socat[9] E connect(5, AF=2 172.17.0.1:4999, 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 10.11.0.0/16 \
--opt com.docker.network.bridge.name=docker_gwbridge \
--opt com.docker.network.bridge.enable_icc=false \
--opt com.docker.network.bridge.enable_ip_masquerade=true \
docker_gwbridge
Then In the compose file for the stack deployment I run the image like so
dockerd-exporter:
image: alpine/socat
networks:
- monitoring
command: -d -d TCP-L:4999,fork TCP:10.11.0.1:4999
deploy:
mode: global
And in Prometheus config
- job_name: 'dockerd-exporter'
dns_sd_configs:
- 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 https://github.com/bluebrown/linode-swarm
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.