{"id":16488621,"url":"https://github.com/kerams/docker-exporter","last_synced_at":"2025-05-02T13:30:32.662Z","repository":{"id":155420625,"uuid":"624891235","full_name":"kerams/docker-exporter","owner":"kerams","description":"Minimal Prometheus exporter for Docker container, volume and image metrics.","archived":false,"fork":false,"pushed_at":"2025-04-20T16:06:39.000Z","size":337,"stargazers_count":5,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-20T17:23:33.036Z","etag":null,"topics":["docker","prometheus-exporter","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/kerams.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2023-04-07T14:14:06.000Z","updated_at":"2025-04-20T16:06:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"3d361648-aba6-4779-9c23-878f18724b79","html_url":"https://github.com/kerams/docker-exporter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kerams%2Fdocker-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kerams%2Fdocker-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kerams%2Fdocker-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kerams%2Fdocker-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kerams","download_url":"https://codeload.github.com/kerams/docker-exporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252046014,"owners_count":21685933,"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":["docker","prometheus-exporter","rust"],"created_at":"2024-10-11T13:39:23.302Z","updated_at":"2025-05-02T13:30:32.656Z","avatar_url":"https://github.com/kerams.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker-exporter\r\n\r\n [![](https://img.shields.io/docker/image-size/keramss/docker-exporter)](https://hub.docker.com/r/keramss/docker-exporter)\r\n\r\nMinimal [Prometheus](https://github.com/prometheus/prometheus) exporter for Docker, \u003c1MB compressed image size, \u003c2MB memory footprint. Collects container metrics and optionally also images and volumes.\r\n\r\n## Supported platforms\r\n\r\n- linux/amd64\r\n- linux/arm64\r\n\r\n## Getting started\r\n\r\nImage available on [Docker Hub](https://hub.docker.com/r/keramss/docker-exporter).\r\n\r\nConfiguration via environment variables:\r\n- `VERBOSE` - enables verbose logging (off by default)\r\n- `COLLECT_VOLUME_METRICS` - enables volume metrics collection (off by default)\r\n- `COLLECT_IMAGE_METRICS` - enables image metrics collection (off by default)\r\n\r\nTo run the exporter, use docker-compose.yml:\r\n\r\n```yml\r\nversion: '3.7'\r\n  services:\r\n    docker-exporter:\r\n      image: keramss/docker-exporter:2023-07-22T09-48-10Z\r\n      restart: unless-stopped\r\n      environment:\r\n        # VERBOSE: 'true'\r\n        # COLLECT_VOLUME_METRICS: 'true'\r\n        # COLLECT_IMAGE_METRICS: 'true'\r\n      ports:\r\n        - \"9417:9417\"\r\n      volumes:\r\n        - /var/run/docker.sock:/var/run/docker.sock\r\n```\r\n\r\nor the following command:\r\n\r\n```\r\ndocker run -d \\\r\n    --name docker-exporter \\\r\n    -p 9417:9417 \\\r\n    -v /var/run/docker.sock:/var/run/docker.sock \\\r\n    keramss/docker-exporter:2023-07-22T09-48-10Z\r\n```\r\n\r\nFinally, add a new job to `prometheus.yml`.\r\n\r\n```yml\r\nscrape_configs:\r\n  # ...\r\n  - job_name: 'docker'\r\n    fallback_scrape_protocol: PrometheusText0.0.4\r\n    static_configs:\r\n    - targets: ['your-docker-host:9417']\r\n```\r\n\r\n## Docker API compatibility\r\n\r\nUnix socket only. Requires that the minimum supported API version of your Docker engine be 1.25 or lower.\r\n\r\n## Collected metrics\r\n\r\n### Containers\r\n\r\n- `docker_container_cpu_capacity_total` - All potential CPU usage available to a container, in unspecified units, averaged for all logical CPUs usable by the container. Start point of measurement is undefined - only relative values should be used in analytics.\r\n  \r\n  Labels: name\r\n\r\n- `docker_container_cpu_used_total` - Accumulated CPU usage of a container, in unspecified units, averaged for all logical CPUs usable by the container.\r\n\r\n  Labels: name\r\n\r\n- `docker_container_memory_used_bytes` - Memory usage of a container.\r\n\r\n  Labels: name\r\n\r\n- `docker_container_network_in_bytes` - Total bytes received by the container's network interfaces.\r\n\r\n  Labels: name\r\n\r\n- `docker_container_network_out_bytes` - Total bytes sent by the container's network interfaces.\r\n\r\n  Labels: name\r\n\r\n- `docker_container_disk_read_bytes` - Total bytes read from disk by a container.\r\n\r\n  Labels: name\r\n\r\n- `docker_container_disk_write_bytes` - Total bytes written to disk by a container.\r\n\r\n  Labels: name\r\n\r\n- `docker_container_restart_count` - The number of times the runtime has restarted this container without explicit user action, since the container was last started.\r\n\r\n  Labels: name\r\n\r\n- `docker_container_running_state` - Whether the container is running (1), restarting (0.5) or stopped (0).\r\n\r\n  Labels: name\r\n\r\n- `docker_container_start_time_seconds` - Unix timestamp indicating when the container was started. Does not get reset by automatic restarts.\r\n\r\n  Labels: name\r\n\r\n### Volumes\r\n\r\n- `docker_volume_container_count` - The number of containers using a volume.\r\n\r\n  Labels: name\r\n\r\n- `docker_volume_size` - The size of a volume in bytes.\r\n\r\n  Labels: name\r\n\r\n### Images\r\n\r\n- `docker_image_container_count` - The number of containers based on an image.\r\n\r\n  Labels: tag (may contain image ID if tags are empty or `\u003cnone\u003e:\u003cnone\u003e`)\r\n\r\n- `docker_image_size` - The size of on an image in bytes.\r\n\r\n  Labels: tag (may contain image ID if tags are empty or `\u003cnone\u003e:\u003cnone\u003e`)\r\n\r\n### Overall\r\n\r\n- `docker_probe_duration_seconds_bucket` - A histogram of how long it takes to query Docker for the complete data set.\r\n\r\n- `docker_probe_failures_total` - The number of times any individual Docker query failed (because of a timeout or other reasons).\r\n\r\n## Grafana dashboard\r\n\r\n[Grab it here.](dashboard.json)\r\n\r\n![](1.png)\r\n\r\n![](2.png)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkerams%2Fdocker-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkerams%2Fdocker-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkerams%2Fdocker-exporter/lists"}