Skip to content
This repository has been archived by the owner on Feb 20, 2022. It is now read-only.

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Cobertos
Copy link

@Cobertos Cobertos commented Aug 28, 2020

Fixes #7

@Cobertos
Copy link
Author

Cobertos commented Aug 28, 2020

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
Copy link
Author

Any chance this can get merged @sandersaares ?

@Cobertos
Copy link
Author

Cobertos commented Feb 8, 2021

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

@zkhcohen
Copy link

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

@mr-simonski
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docker container healthy
3 participants