https://github.com/iterait/prometheus-docker-discovery
Prometheus Docker Discovery
https://github.com/iterait/prometheus-docker-discovery
docker metrics prometheus
Last synced: 10 months ago
JSON representation
Prometheus Docker Discovery
- Host: GitHub
- URL: https://github.com/iterait/prometheus-docker-discovery
- Owner: iterait
- License: mit
- Created: 2024-01-12T11:20:47.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-11-07T09:25:29.000Z (over 1 year ago)
- Last Synced: 2025-03-31T17:13:28.287Z (over 1 year ago)
- Topics: docker, metrics, prometheus
- Language: Python
- Homepage: https://hub.docker.com/repository/docker/iterait/prometheus-docker-discovery
- Size: 23.4 KB
- Stars: 4
- Watchers: 5
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Prometheus Docker Discovery
Prometheus Docker Discovery is a service tailored to seamlessly export the [Prometheus](https://prometheus.io/) metrics for [Docker](https://www.docker.com/) containers and volumes.
This enhances the monitoring and observability of your Dockerized applications, providing insights into resource utilization, container health, and other critical metrics.
## Supported Metrics
This service currently supports a set of monitoring metrics:
- `docker_container_memory_usage_bytes` - Container memory usage, excluding caches
- `docker_container_cpu_usage_percent` - Container CPU usage percent, not divided by number of CPU cores
- `docker_container_uptime_seconds` - Container uptime
- `docker_container_rootfs_size_bytes` - Container `rootfs` size in bytes
- `docker_container_disk_size_bytes` - Container size on disk in bytes
- `docker_container_mount_count` - Number of container mounts
- `docker_volume_size_bytes` - Volume size
## Container Metrics Registration via Labels
Effortlessly register container metrics by adding specific labels to the container. The following labels are essential:
- `prometheus.job=`: Assign a job name for Prometheus to identify, collect and export metrics.
- Optionally, enhance metric granularity by incorporating additional labels through `prometheus.labels.=`.
## Run Prometheus Docker Discovery
Supposing there are already some correctly labeled containers, you can initiate Prometheus Docker Discovery with the following command:
```bash
docker run -p 8000:8000 -v /var/run/docker.sock:/var/run/docker.sock iterait/prometheus-docker-discovery:master
```
Access the metrics endpoint at http://localhost:8000/metrics.
Be patient, as the metrics might take a while to become available.
## Example compose.yaml
Integrate Prometheus Docker Discovery seamlessly into your Docker-compose environment with this [example configuration](./compose.example.yaml):
## License
Prometheus Docker Discovery is released under the [MIT License](./LICENSE).
## Collaboration
We welcome and encourage collaboration from the community.
If you find Prometheus Docker Discovery useful or have ideas for improvement, please feel free to contribute to the project.
To get started, fork the repository, make your changes, and submit a pull request.