I want to set up monitoring for my Docker containers. I've heard Prometheus + Grafana is the standard stack. How do I get started?
Sign in to answer, or post anonymously below.
Use cAdvisor to expose container metrics, then scrape with Prometheus.
Quick setup with Docker Compose:
services:
prometheus:
image: prom/prometheus
ports: ["9090:9090"]
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
grafana:
image: grafana/grafana
ports: ["3000:3000"]
cadvisor:
image: gcr.io/cadvisor/cadvisor
ports: ["8080:8080"]
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker:/var/lib/docker:ro
See our full Monitoring with Prometheus & Grafana article for dashboards and alerting.