Stack di monitoraggio
Per monitoraggio avanzato con metriche dettagliate di CPU, RAM, disco, rete:
- Prometheus: raccoglie e archivia metriche (time-series DB)
- Grafana: visualizza le metriche in dashboard interattive
- Node Exporter: espone metriche del sistema Linux
- cAdvisor: metriche dei container Docker
docker-compose.yml completo
version: '3.8'
services:
prometheus:
image: prom/prometheus:latest
restart: unless-stopped
ports:
- "9090:9090"
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
grafana:
image: grafana/grafana:latest
restart: unless-stopped
ports:
- "3000:3000"
volumes:
- grafana_data:/var/lib/grafana
environment:
- GF_SECURITY_ADMIN_PASSWORD=password_sicura
node-exporter:
image: prom/node-exporter:latest
restart: unless-stopped
ports:
- "9100:9100"
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
command:
- '--path.procfs=/host/proc'
- '--path.sysfs=/host/sys'
cadvisor:
image: gcr.io/cadvisor/cadvisor:latest
restart: unless-stopped
ports:
- "8080:8080"
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker:/var/lib/docker:ro
volumes:
prometheus_data:
grafana_data:
prometheus.yml
global:
scrape_interval: 15s
scrape_configs:
- job_name: 'node'
static_configs:
- targets: ['node-exporter:9100']
- job_name: 'cadvisor'
static_configs:
- targets: ['cadvisor:8080']
Dashboard Grafana
Accedi a http://IP:3000. In Grafana → Dashboards → Import → inserisci ID:
- 1860: Node Exporter Full — metriche host complete
- 893: Docker and system monitoring — metriche container
💬 Commenti (0)
Nessun commento ancora. Sii il primo!