Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

Prometheus exporter for container metrics cAdvisor won't give you

License

NotificationsYou must be signed in to change notification settings

draganm/missing-container-metrics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker PullsDocker Image Version

STATUS: stable, maintained

cadvisor is great, but missing a few important metrics, that every serious devops person wants to know about.This is a secondary process to export all the missingPrometheus metrics:

  • OOM-kill
  • number of container restarts
  • last exit code

This was motivated by hunting down a OOM kills in a large Kubernetes cluster.It's possible for containers to keep running, even after a OOM-kill, if asub-process got affect for example. Without this metric, it becomes much moredifficult to find the root cause of the issue.

True story; after this was deployed, a recurring OOM-kill in Fluentd wasquickly discovered on one of the nodes. It turns out that the resource limitswere set too low to process logs on that node. Logs werenot being forwarded because the Fluentd worker process kept being OOM-kill andthen restarted by the main process. A fix was then deployed 10 minutes later.

Supported Container Runtimes

  • Docker
  • Containerd

Kubernetes 1.20 has deprecated Docker container runtime, so we have added support for Containerd since the version0.21.0 ofmissing-container-metrics.Both options should cover most of common use cases (EKS, GKE, K3S, Digital Ocean Kubernetes, ...).

Deployment

Kubernetes

The easiest way of installingmissing-container-metrics in your kubernetes cluster is using ourhelm chart.

Docker

$ docker run -d -p 3001:3001 -v /var/run/docker.sock:/var/run/docker.sock dmilhdef/missing-container-metrics:v0.14.0

Usage

Exposes metrics about Docker/Containerd containers.Every metric contains following labels:

Exposed Metrics

Each of those metrics, are published with the labels from the next section.

container_restarts (counter)

Number of restarts of the container.

container_ooms (counter)

Number of OOM kills for the container. This covers OOM kill of any process in the container cgroup.

container_last_exit_code (gauge)

Last exit code of the container.

Labels

docker_container_id

Full id of the container.

container_short_id

First 6 bytes of the Docker container id.

container_id

Container id represented in the same format as in metrics of kubernetes pods - prefixed withdocker:// andcontainerd:// depending on the container runtime. This enables easy joins in Prometheus tokube_pod_container_info metric.

name

Name of the container.

image_id

Image id represented in the same format as in metrics of k8s pod. This enables easy joins in Prometheus tokube_pod_container_info metric.

pod

Ifio.kubernetes.pod.name label is set on the container, it's valuewill be set as thepod label in the metric

namespace

Ifio.kubernetes.pod.namespace label is set on the container, it's valuewill be set as thenamespace label of the metric.

Together withpod, this label is useful in the context of Kubernetes deployments, to determine namespace/pod to which the container is part of.One can see it as a shortcut to joining with thekube_pod_container_info metric to determine those values.

Contributing

Contributions are welcome, send your issues and PRs to this repo.

License

MIT - Copyright Dragan Milic and contributors

About

Prometheus exporter for container metrics cAdvisor won't give you

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp