A Prometheus metrics collector for Docker, similar to node-exporter but designed for containerized environments, offering a simpler alternative to cadvisor with lower resource consumption.
docker_exporter_state_running_booleandocker_exporter_state_healthy_booleandocker_exporter_cpu_utilization_percentdocker_exporter_memory_usage_bytesdocker_exporter_memory_limit_bytesdocker_exporter_memory_utilization_percentdocker_exporter_block_io_tx_bytes_totaldocker_exporter_block_io_rx_bytes_totaldocker_exporter_network_tx_bytes_totaldocker_exporter_network_rx_bytes_total
To get started with Docker-Exporter, follow these steps:
- Pull the Docker-Exporter image from the official Docker Hub repository and run the container with the specified configurations:
docker run -d \
--name docker-exporter \
--restart always \
-p 9630:9630 \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
patrickap/docker-exporter:latestAlternatively, you can use Docker Compose:
version: "3.7"
services:
docker-exporter:
image: patrickap/docker-exporter:latest
restart: always
ports: 9630:9630
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro- The metrics are now available at
localhost:9630/metrics
To start the local development server, execute cargo run. You can access the metrics by navigating to http://0.0.0.0:9630/metrics in your browser. To run the tests, use the command cargo test. For building and releasing the Docker image, run just release <patch|minor|major>, which will automatically increment the version.