docker_exporter icon indicating copy to clipboard operation
docker_exporter copied to clipboard

Added docker container State.Health.Status as a metric #7

Open Cobertos opened this issue 4 years ago • 5 comments

Fixes #7

Cobertos avatar Aug 28 '20 03:08 Cobertos

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

image

Cobertos avatar Aug 28 '20 06:08 Cobertos

Any chance this can get merged @sandersaares ?

Cobertos avatar Jan 14 '21 20:01 Cobertos

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

Cobertos avatar Feb 08 '21 19:02 Cobertos

Why hasn't this been merged yet. Really disappointing that no one has taken the time to review it... this is basic functionality.

zkhcohen avatar Jul 15 '21 20:07 zkhcohen

@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.

mr-simonski avatar Jul 23 '21 11:07 mr-simonski