Prometheus Docker Discovery is a service tailored to seamlessly export the Prometheus metrics for Docker containers and volumes. This enhances the monitoring and observability of your Dockerized applications, providing insights into resource utilization, container health, and other critical metrics.
This service currently supports a set of monitoring metrics:
docker_container_memory_usage_bytes
- Container memory usage, excluding cachesdocker_container_cpu_usage_percent
- Container CPU usage percent, not divided by number of CPU coresdocker_container_uptime_seconds
- Container uptimedocker_container_rootfs_size_bytes
- Containerrootfs
size in bytesdocker_container_disk_size_bytes
- Container size on disk in bytesdocker_container_mount_count
- Number of container mountsdocker_volume_size_bytes
- Volume size
Effortlessly register container metrics by adding specific labels to the container. The following labels are essential:
prometheus.job=<job-name>
: Assign a job name for Prometheus to identify, collect and export metrics.- Optionally, enhance metric granularity by incorporating additional labels through
prometheus.labels.<label-name>=<label-value>
.
Supposing there are already some correctly labeled containers, you can initiate Prometheus Docker Discovery with the following command:
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.
Integrate Prometheus Docker Discovery seamlessly into your Docker-compose environment with this example configuration:
Prometheus Docker Discovery is released under the MIT License.
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.