{"id":13581647,"url":"https://github.com/draganm/missing-container-metrics","last_synced_at":"2025-04-24T04:11:00.487Z","repository":{"id":38303355,"uuid":"294352510","full_name":"draganm/missing-container-metrics","owner":"draganm","description":"Prometheus exporter for container metrics cAdvisor won't give you","archived":false,"fork":false,"pushed_at":"2024-06-20T14:03:16.000Z","size":114,"stargazers_count":175,"open_issues_count":17,"forks_count":32,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-30T06:41:21.266Z","etag":null,"topics":["containerd","exposed-metrics","kubernetes","metrics"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/draganm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-10T08:39:46.000Z","updated_at":"2025-03-21T12:13:24.000Z","dependencies_parsed_at":"2024-01-13T15:45:23.752Z","dependency_job_id":"80a709c3-5de0-49ff-9d59-7325a066561b","html_url":"https://github.com/draganm/missing-container-metrics","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/draganm%2Fmissing-container-metrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/draganm%2Fmissing-container-metrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/draganm%2Fmissing-container-metrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/draganm%2Fmissing-container-metrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/draganm","download_url":"https://codeload.github.com/draganm/missing-container-metrics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250560053,"owners_count":21450172,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["containerd","exposed-metrics","kubernetes","metrics"],"created_at":"2024-08-01T15:02:09.178Z","updated_at":"2025-04-24T04:11:00.468Z","avatar_url":"https://github.com/draganm.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Missing Container Metrics - metrics cadvisor won't give you\n\n[![Docker Pulls](https://img.shields.io/docker/pulls/dmilhdef/missing-container-metrics.svg?maxAge=604800)][hub]\n[![Docker Image Version](https://img.shields.io/docker/v/dmilhdef/missing-container-metrics?sort=semver)][hub]\n\n\n**STATUS: stable, maintained**\n\ncadvisor is great, but missing a few important metrics, that every serious devops person wants to know about.\nThis is a secondary process to export all the missing [Prometheus](https://prometheus.io) metrics:\n\n* OOM-kill\n* number of container restarts\n* last exit code\n\nThis was motivated by hunting down a OOM kills in a large Kubernetes cluster.\nIt's possible for containers to keep running, even after a OOM-kill, if a\nsub-process got affect for example. Without this metric, it becomes much more\ndifficult to find the root cause of the issue.\n\nTrue story; after this was deployed, a recurring OOM-kill in Fluentd was\nquickly discovered on one of the nodes. It turns out that the resource limits\nwere set too low to process logs on that node. Logs were\nnot being forwarded because the Fluentd worker process kept being OOM-kill and\nthen restarted by the main process. A fix was then deployed 10 minutes later.\n\n## Supported Container Runtimes\n* Docker\n* Containerd\n\nKubernetes 1.20 has deprecated Docker container runtime, so we have added support for Containerd since the version `0.21.0` of `missing-container-metrics`.\nBoth options should cover most of common use cases (EKS, GKE, K3S, Digital Ocean Kubernetes, ...).\n\n## Deployment\n\n### Kubernetes\n\nThe easiest way of installing `missing-container-metrics` in your kubernetes cluster is using our [helm chart](https://artifacthub.io/packages/helm/missing-container-metrics/missing-container-metrics).\n\n\n### Docker\n\n```sh\n$ docker run -d -p 3001:3001 -v /var/run/docker.sock:/var/run/docker.sock dmilhdef/missing-container-metrics:v0.14.0\n```\n\n## Usage\n\nExposes metrics about Docker/Containerd containers.\nEvery metric contains following labels:\n## Exposed Metrics\n\nEach of those metrics, are published with the labels from the next section.\n\n### `container_restarts` (counter)\n\nNumber of restarts of the container. \n\n### `container_ooms` (counter)\n\nNumber of OOM kills for the container. This covers OOM kill of any process in the container cgroup.\n\n### `container_last_exit_code` (gauge)\n\nLast exit code of the container.\n\n## Labels\n\n### `docker_container_id`\n\nFull id of the container.\n\n### `container_short_id`\n\nFirst 6 bytes of the Docker container id.\n\n### `container_id`\n\nContainer id represented in the same format as in metrics of kubernetes pods - prefixed with `docker://` and `containerd://` depending on the container runtime. This enables easy joins in Prometheus to `kube_pod_container_info` metric.\n\n### `name`\n\nName of the container.\n\n### `image_id`\n\nImage id represented in the same format as in metrics of k8s pod. This enables easy joins in Prometheus to `kube_pod_container_info` metric.\n\n### `pod`\n\nIf `io.kubernetes.pod.name` label is set on the container, it's value\nwill be set as the `pod` label in the metric\n\n### `namespace`\n\nIf `io.kubernetes.pod.namespace` label is set on the container, it's value\nwill be set as the `namespace` label of the metric.\n\nTogether with `pod`, this label is useful in the context of Kubernetes deployments, to determine namespace/pod to which the container is part of.\nOne can see it as a shortcut to joining with the `kube_pod_container_info` metric to determine those values.\n\n\n## Contributing\n\nContributions are welcome, send your issues and PRs to this repo.\n\n## License\n\n[MIT](LICENSE) - Copyright Dragan Milic and contributors\n\n\n[hub]: https://hub.docker.com/r/dmilhdef/missing-container-metrics/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdraganm%2Fmissing-container-metrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdraganm%2Fmissing-container-metrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdraganm%2Fmissing-container-metrics/lists"}