Created
June 5, 2025 10:37
-
-
Save dipankardas011/b73fa330a5e177ae11b042da2593330b to your computer and use it in GitHub Desktop.
monitoring prom+nodeexporter docker compose
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
networks: | |
monitoring: | |
volumes: | |
prometheus_data: {} | |
services: | |
node-exporter: | |
image: prom/node-exporter:latest | |
container_name: node-exporter | |
restart: unless-stopped | |
volumes: | |
- /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)($$|/)' | |
ports: | |
- 9100:9100 | |
networks: | |
- monitoring | |
prometheus: | |
image: prom/prometheus:latest | |
container_name: prometheus | |
restart: unless-stopped | |
volumes: | |
- ./prometheus.yml:/etc/prometheus/prometheus.yml | |
- prometheus_data:/prometheus | |
command: | |
- '--config.file=/etc/prometheus/prometheus.yml' | |
- '--storage.tsdb.path=/prometheus' | |
- '--web.console.libraries=/etc/prometheus/console_libraries' | |
- '--web.console.templates=/etc/prometheus/consoles' | |
- '--web.enable-lifecycle' | |
ports: | |
- 9090:9090 | |
networks: | |
- monitoring |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global: | |
scrape_interval: 1m | |
scrape_configs: | |
- job_name: 'prometheus' | |
scrape_interval: 1m | |
static_configs: | |
- targets: ['localhost:9090'] | |
- job_name: 'node' | |
static_configs: | |
- targets: ['node-exporter:9100'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment