-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prometheus metric for container healthcheck status #2166
Comments
Does an equivalent exist for all container runtimes cAdvisor supports (mesos, containerd, rkt, docker)? We usually try and stay away from spec-based metrics, as they tend to be runtime-specific, and generate large numbers of metric streams for each container. |
I'm quite unaware of all specifications that could exist at this time. I'm under the impression (and could be wrong) that the OCI had or would propose something standard for this. So, I've no idea unfortunately The need I have is to have a metric that is about the work produced by a container rather than a state ( The healthcheck instruction and related statistics with docker helps to really figure out if a container actually does what it should and I don't really see metrics about that for now |
This would be one very useful addition. |
Does anyone find the workaround? |
I am also looking to accomplish this. |
The kubelet does have these kind of metrics: https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/prober/prober_manager.go#L38. But that doesn't help anyone not using kubernetes... I'm not sure if cAdvisor should take on metrics collection on probes, as it isn't performing them. I believe we currently only fetch the container from docker at container creation time, so this would require us to poll the runtime for the information. I'm not sure we can provide accurate cumulative probe metrics based on sampling the state. It seems like we are bound to miss probe failures. |
Hi Team, Any advice/update/workaround here is much helpful for everyone. We needed this "health_check" very badly. |
Hi everybody! |
Also, for alerts |
It's hard to create alerts based on metrics that disappear and it also goes against prometheus best practices. I still don't understand why we can't just use absent and move on but you can read more about it here: Recently, a coworker discovered this exporter: Which exposed a very valuable metric: Here's an example:
|
Healthchecking should be added to the above repo when prometheus-net/docker_exporter#11 is merged. |
To solve this issue, I created an application that exports the state of the container in Go language. https://github.com/karugaru/docker_state_exporter Try it if you like! |
Can someone add this metric for monitoring HEALTCHECK of a container? (https://docs.docker.com/engine/reference/builder/#healthcheck) |
Is there any progress about this issue? |
Up! |
Is there a way to do that in 2023 ? |
I just had a play with the source code and I somewhat made a working poc which I commited to my fork The metric is called
Anyone wants to give it a try? You'll have to compile cadvisor from source or I can provide a compiled binary |
Hi,
As far as I know, no metrics are available for healthcheck status of a container.
I see a metric about the "up" state of a container (
container_last_seen
) but nothing about what can be checked overState.Health.Status
with dockerThis statistic isn't really a metric because it return a string but i would guess that a bolean for each possible value would be useful (running, healthy, unhealthy for the ones I know )
The text was updated successfully, but these errors were encountered: