docker_exporter
docker_exporter copied to clipboard
Added docker container State.Health.Status as a metric #7
Fixes #7
So the final implementation for the gauge is as follows:
- Healthy = 1
- Starting = 0.5
- Unhealthy = 0
- No health information, we never publish the gauge, and unpublish if it was previously published, but I don't know if that's even possible.
Here's the output. In this case, practical_merkle
is a container meant to always be unhealthy, HEALTHCHECK CMD exit 1
Any chance this can get merged @sandersaares ?
If anyone is looking to use this today, you can always use a git submodule.
git submodule add https://github.com/Cobertos/docker_exporter
Then in your docker-compose.yml
prometheus-docker-exporter:
build:
context: docker_exporter/
restart: always
container_name: prometheus-docker-exporter
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
Why hasn't this been merged yet. Really disappointing that no one has taken the time to review it... this is basic functionality.
@sandersaares I would need this as well. Our images might not start due to unforeseen situations during boot of our APIs. Docker marks them as running while our healthchecks indicate the truth, that they are starting for ages. Would be very helpful to have this merged.