remove node exporter and add alloy for metrics
This commit is contained in:
+7
-40
@@ -84,60 +84,27 @@ services:
|
||||
max_attempts: 3
|
||||
window: 120s
|
||||
|
||||
# cAdvisor for container metrics
|
||||
cadvisor:
|
||||
image: gcr.io/cadvisor/cadvisor:v0.49.1
|
||||
container_name: cadvisor
|
||||
volumes:
|
||||
- /:/rootfs:ro
|
||||
- /var/run:/var/run:ro
|
||||
- /sys:/sys:ro
|
||||
- /var/lib/docker/:/var/lib/docker:ro
|
||||
- /dev/disk/:/dev/disk:ro
|
||||
ports:
|
||||
- "9050:8080"
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- monitoring
|
||||
privileged: true
|
||||
devices:
|
||||
- /dev/kmsg:/dev/kmsg
|
||||
|
||||
# Node Exporter for host metrics
|
||||
node-exporter:
|
||||
image: prom/node-exporter:latest
|
||||
container_name: node-exporter
|
||||
volumes:
|
||||
- /proc:/host/proc:ro
|
||||
- /sys:/host/sys:ro
|
||||
- /:/rootfs:ro
|
||||
command:
|
||||
- '--path.procfs=/host/proc'
|
||||
- '--path.sysfs=/host/sys'
|
||||
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
|
||||
ports:
|
||||
- "9060:9100"
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- monitoring
|
||||
alloy:
|
||||
image: grafana/alloy:latest
|
||||
container_name: alloy
|
||||
volumes:
|
||||
- ./config/config.alloy:/etc/alloy/config.alloy
|
||||
- /home/container_user/logs:/var/log:ro # Read-only mount of host logs
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- /proc:/host/proc:ro # CRITICAL - must be mounted at /host/proc
|
||||
- /sys:/host/sys:ro # CRITICAL - must be mounted at /host/sys
|
||||
- /:/rootfs:ro # CRITICAL - must be mounted at /rootfs
|
||||
command:
|
||||
- run
|
||||
- --server.http.listen-addr=0.0.0.0:12345
|
||||
- --storage.path=/var/lib/alloy/data
|
||||
- /etc/alloy/config.alloy
|
||||
ports:
|
||||
- "12345:12345" # Expose the Alloy UI
|
||||
restart: unless-stopped
|
||||
- "12345:12345"
|
||||
privileged: true # CRITICAL for accessing system metrics
|
||||
pid: "host" # CRITICAL for accessing process metrics
|
||||
networks:
|
||||
- monitoring
|
||||
|
||||
|
||||
volumes:
|
||||
grafana-data:
|
||||
prometheus-data:
|
||||
|
||||
Reference in New Issue
Block a user