https://github.com/0xerr0r/dex
Prometheus Docker EXporter
https://github.com/0xerr0r/dex
docker golang grafana-dashboard prometheus-exporter
Last synced: about 1 year ago
JSON representation
Prometheus Docker EXporter
- Host: GitHub
- URL: https://github.com/0xerr0r/dex
- Owner: 0xERR0R
- Created: 2020-04-12T14:52:55.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2025-03-26T13:04:54.000Z (over 1 year ago)
- Last Synced: 2025-03-26T14:24:48.562Z (over 1 year ago)
- Topics: docker, golang, grafana-dashboard, prometheus-exporter
- Language: Go
- Homepage:
- Size: 887 KB
- Stars: 65
- Watchers: 3
- Forks: 10
- Open Issues: 2
-
Metadata Files:
- Readme: docs/README.md
Awesome Lists containing this project
README
# DEX - Docker EXporter for prometheus
DEX is a lightweight Prometheus exporter that monitors Docker containers and exports their metrics. It's designed to run as a Docker container and supports all architectures.
## Key Features
- Lightweight and efficient
- Supports all architectures
- Real-time container metrics monitoring
- Easy integration with Prometheus and Grafana
- No configuration required for basic usage
## Exposed Metrics
| Metric Name | Type | Description |
|------------|------|-------------|
| dex_block_io_read_bytes_total | Counter | Total number of bytes read from block devices |
| dex_block_io_write_bytes_total | Counter | Total number of bytes written to block devices |
| dex_container_exited | Gauge | 1 if container has exited, 0 otherwise |
| dex_container_restarting | Gauge | 1 if container is restarting, 0 otherwise |
| dex_container_restarts_total | Counter | Total number of container restarts |
| dex_container_running | Gauge | 1 if container is running, 0 otherwise |
| dex_cpu_utilization_percent | Gauge | Current CPU utilization percentage |
| dex_cpu_utilization_seconds_total | Counter | Cumulative CPU time consumed |
| dex_memory_total_bytes | Gauge | Total memory limit in bytes |
| dex_memory_usage_bytes | Counter | Current memory usage in bytes |
| dex_memory_utilization_percent | Gauge | Current memory utilization percentage |
| dex_network_rx_bytes_total | Counter | Total bytes received over network |
| dex_network_tx_bytes_total | Counter | Total bytes transmitted over network |
| dex_pids_current | Counter | Current number of processes in the container |
## Prerequisites
- Docker installed and running
- Prometheus server (for metrics collection)
- Grafana (optional, for visualization)
## Run with docker
Start docker container with following `docker-compose.yml`:
```yml
version: '2.1'
services:
dex:
image: spx01/dex
container_name: dex
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 8386:8080
restart: always
```
## Test with curl
```
$ curl localhost:8386/metrics
```
## Grafana dashboard
### Grafana 7
Example grafana7 dashboard definition [as JSON](grafana7.json)
.
### Grafana 8
Another dashboard for Grafana 8 (thanks @scMarkus !!!) [as JSON](grafana8.json)

Modification (thanks @GitSchorsch) with additional job filter [as JSON](grafana8_2.json)