Files
simple-docker-metrics/compose.yml
2025-12-14 20:59:43 +01:00

60 lines
1.8 KiB
YAML

services:
simple-docker-metrics:
build:
context: ./src
dockerfile: Containerfile
container_name: simple-docker-metrics
user: "0:0"
environment:
# Connection settings
- GRAPHITE_ENDPOINT=graphite:2003
- GRAPHITE_PREFIX=docker-metrics
- INTERVAL_SECONDS=10
- DEBUG=false
# Performance settings
- PARALLEL_COLLECTION=true # Enable parallel metric collection
- MAX_WORKERS=4 # Number of parallel workers
- CACHE_TTL_SECONDS=300 # Cache duration for expensive operations (5 min)
# Enable/disable collectors
- COLLECT_CONTAINER_METRICS=true
- COLLECT_VOLUME_METRICS=true
- COLLECT_SYSTEM_METRICS=true
- COLLECT_SELF_METRICS=true
# Container metric labels (comma-separated: cpu,memory,network,blkio,state,health,restart_count,disk)
# - CONTAINER_LABELS=cpu,memory,state # Uncomment to only collect specific labels
# Volume metric labels (comma-separated: container_count,labels_count)
# - VOLUME_LABELS=container_count
# System metric labels (comma-separated: containers,images,storage)
# - SYSTEM_LABELS=containers,images
# Aggregations
- ENABLE_AGGREGATIONS=true
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
restart: unless-stopped
depends_on:
- graphite
graphite:
image: graphiteapp/graphite-statsd:latest
container_name: graphite
ports:
- "80:80" # Graphite web interface
- "2003:2003" # Carbon plaintext
- "2004:2004" # Carbon pickle
- "8125:8125/udp" # StatsD
- "8126:8126" # StatsD admin
restart: unless-stopped
volumes:
- graphite-data:/opt/graphite/storage
- graphite-config:/opt/graphite/conf
volumes:
graphite-data:
graphite-config: