{"id":16397490,"url":"https://github.com/davidborzek/docker-exporter","last_synced_at":"2025-06-12T11:41:23.270Z","repository":{"id":195423658,"uuid":"692779434","full_name":"davidborzek/docker-exporter","owner":"davidborzek","description":"Prometheus docker exporter","archived":false,"fork":false,"pushed_at":"2024-05-17T00:14:39.000Z","size":65,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-17T01:29:07.264Z","etag":null,"topics":["containers","docker","docker-metrics","docker-prometheus","grafana","metrics","prometheus","prometheus-exporter"],"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/davidborzek.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}},"created_at":"2023-09-17T15:02:20.000Z","updated_at":"2024-05-17T01:29:09.226Z","dependencies_parsed_at":"2024-02-25T23:24:20.756Z","dependency_job_id":"39de5944-c13c-4ae2-9a60-48f4d1fe72a7","html_url":"https://github.com/davidborzek/docker-exporter","commit_stats":{"total_commits":35,"total_committers":2,"mean_commits":17.5,"dds":0.4571428571428572,"last_synced_commit":"24734a1c288e5498c877d3c58d47871f1554aa85"},"previous_names":["davidborzek/docker-exporter"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidborzek%2Fdocker-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidborzek%2Fdocker-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidborzek%2Fdocker-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidborzek%2Fdocker-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidborzek","download_url":"https://codeload.github.com/davidborzek/docker-exporter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243573168,"owners_count":20312879,"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":["containers","docker","docker-metrics","docker-prometheus","grafana","metrics","prometheus","prometheus-exporter"],"created_at":"2024-10-11T05:10:14.279Z","updated_at":"2025-03-14T11:42:51.315Z","avatar_url":"https://github.com/davidborzek.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker exporter\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/davidborzek/docker-exporter)](https://goreportcard.com/report/github.com/davidborzek/docker-exporter)\n\nSimple and lightweight Prometheus exporter for docker container metrics.\n\n## Prerequisites\n\n- [Go](https://golang.org/doc/)\n\n## Installation\n\n### Using Docker\n\nThe exporter is available as a Docker image.\nYou can run it using the following example:\n\n```\n$ docker run \\\n  -u root \\\n  -v /var/run/docker.sock:/var/run/docker.sock \\\n  -p 8080:8080 \\\n  ghcr.io/davidborzek/docker-exporter:latest\n```\n\n\u003e Note: To run Docker Exporter, you'll need to mount the Docker socket from your host system. This operation necessitates root privileges or the user running the command to be a member of the Docker group. It's important to note that mounting the Docker socket grants the container unrestricted access to Docker. For a more secure approach, consider utilizing the Docker Socket Proxy, which is further explained below for additional information.\n\n### Running with [docker-socket-proxy](https://github.com/Tecnativa/docker-socket-proxy)\n\n```\n$ docker run \\\n  -e \"DOCKER_HOST=tcp://localhost:2375\" \\\n  -p 8080:8080 \\\n  ghcr.io/davidborzek/docker-exporter:latest\n```\n\n\u003e Note: the [docker-socket-proxy](https://github.com/Tecnativa/docker-socket-proxy#not-always-needed) needs to have container access enabled. (`CONTAINERS=1`)\n\n### Prometheus config\n\nOnce you have configured the exporter, update your `prometheus.yml` scrape config:\n\n```yaml\nscrape_configs:\n  - job_name: \"docker_exporter\"\n    static_configs:\n      - targets: [\"localhost:8080\"]\n```\n\n### Config\n\n| Flag             | Description                                                                                          | Default Value            | Environment Variable           |\n| ---------------- | ---------------------------------------------------------------------------------------------------- | ------------------------ | ------------------------------ |\n| `--port`         | The port of docker exporter server.                                                                  | `8080`                   | `DOCKER_EXPORTER_PORT`         |\n| `--host`         | The host of docker exporter server.                                                                  |                          | `DOCKER_EXPORTER_HOST`         |\n| `--auth-token`   | Optional auth token for the docker exporter server. If no token is set authentication is disabled.   |                          | `DOCKER_EXPORTER_AUTH_TOKEN`   |\n| `--log-level`    | Log level for the exporter.                                                                          | `info`                   | `DOCKER_EXPORTER_LOG_LEVEL`    |\n| `--ignore-label` | Set the label name for ignoring docker containers. (See [Ignoring Containers](#ignoring-containers)) | `docker-exporter.ignore` | `DOCKER_EXPORTER_IGNORE_LABEL` |\n\n### Exported Metrics\n\n| Metric Name                                 | Description                        | Labels                  |\n| ------------------------------------------- | ---------------------------------- | ----------------------- |\n| docker_container_block_io_read_bytes        | Block I/O read bytes total         | name                    |\n| docker_container_block_io_write_bytes       | Block I/O write bytes total        | name                    |\n| docker_container_cpu_usage_percentage       | CPU usage in percentage            | name                    |\n| docker_container_info                       | Infos about the container          | name, image_name, image |\n| docker_container_memory_total_bytes         | Total memory in bytes              | name                    |\n| docker_container_memory_usage_bytes         | Memory usage in bytes              | name                    |\n| docker_container_memory_usage_percentage    | Memory usage in percentage         | name                    |\n| docker_container_network_rx_bytes           | Network received bytes total       | name, network           |\n| docker_container_network_rx_dropped_packets | Network dropped packets total      | name, network           |\n| docker_container_network_rx_errors          | Network received errors            | name, network           |\n| docker_container_network_rx_packets         | Network received packets total     | name, network           |\n| docker_container_network_tx_bytes           | Network sent bytes total           | name, network           |\n| docker_container_network_tx_dropped_packets | Network dropped packets total      | name, network           |\n| docker_container_network_tx_errors          | Network sent errors                | name, network           |\n| docker_container_network_tx_packets         | Network sent packets total         | name, network           |\n| docker_container_pids_current               | Current number of pids             | name                    |\n| docker_container_state                      | State of the container             | name, state             |\n| docker_container_uptime                     | Uptime of the container in seconds | name                    |\n| docker_exporter_scrape_duration             | Duration of the scrape in seconds  |                         |\n| docker_exporter_scrape_errors               | Number of scrape errors            |                         |\n\n### Ignoring Containers\n\nYou can ignore containers by setting the label `docker-exporter.ignore` on the container. The label name can be configured with the `--ignore-label` flag.\n\n```yaml\nservices:\n  nginx:\n    image: nginx\n    labels:\n      docker-exporter.ignore: \"true\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidborzek%2Fdocker-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidborzek%2Fdocker-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidborzek%2Fdocker-exporter/lists"}