Skip to content
This repository has been archived by the owner on Sep 14, 2024. It is now read-only.

Commit

Permalink
fix prometheus node_exporter in docker swarm mode
Browse files Browse the repository at this point in the history
  • Loading branch information
l3d00m committed Jan 3, 2024
1 parent 52d0d0d commit 4e5475f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
15 changes: 9 additions & 6 deletions roles/monitoring/templates/docker-compose.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,17 @@ services:
max_attempts: 3
window: 120s
node_exporter:
image: quay.io/prometheus/node-exporter:latest
command:
- '--path.rootfs=/host'
network_mode: host
pid: host
image: prom/node-exporter:latest
restart: always
volumes:
- '/:/host:ro,rslave'
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.rootfs=/rootfs'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
networks:
{{ monitoring_network }}:
deploy:
Expand Down
4 changes: 1 addition & 3 deletions roles/monitoring/templates/prometheus.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,5 @@ scrape_configs:
- targets: ["localhost:{{prometheus_port}}"]

- job_name: node
# If prometheus-node-exporter is installed, grab stats about the local
# machine by default.
static_configs:
- targets: ["node-exporter:9100"]
- targets: ["node_exporter:9100"]

0 comments on commit 4e5475f

Please sign in to comment.