Prometheus graphite exporter compose example.
Educational example only. Review every volume path, port, and credential before you run this. Do not copy production secrets into your wiki or git repo.
_shared/.env for non-secrets, _shared/.secret for credentialsmkdir -p /path/to/docker/stacks/graphite-exporter
cd /path/to/docker/stacks/graphite-exporter
# paste compose.yaml below, then:
docker compose pull
docker compose up -d
---
services:
graphite-exporter:
image: prom/graphite-exporter:latest
container_name: graphite-exporter
hostname: graphite-exporter
env_file:
- /path/to/docker/stacks/_shared/.env
- /path/to/docker/stacks/_shared/.secret
ports:
- 9108:9108 # Prometheus scrape endpoint (HTTP)
- 9109:9109 # Graphite plaintext protocol (TCP)
- 9109:9109/udp # Graphite plaintext protocol (UDP)
volumes:
- /path/to/docker/data/graphite-exporter/graphite_mapping.conf:/etc/graphite/graphite_mapping.conf:ro
logging:
driver: json-file
options:
max-file: ${DOCKERLOGGING_MAXFILE:-10} # Max number of log files
max-size: ${DOCKERLOGGING_MAXSIZE:-200k} # Max file size
command:
- "--graphite.mapping-config=/etc/graphite/graphite_mapping.conf"
restart: unless-stopped
_shared/.secret.