-
-
Save Azaferany/0546dee70b135b17daa5a8dc23fe3f1f to your computer and use it in GitHub Desktop.
grafana + prometheus + node_exporter
This file contains 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
version: '3.8' | |
networks: | |
monitoring: | |
driver: bridge | |
volumes: | |
prometheus_data: {} | |
grafana_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)($$|/)' | |
expose: | |
- 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' | |
expose: | |
- 9090 | |
networks: | |
- monitoring | |
grafana: | |
image: grafana/grafana-oss | |
container_name: grafana | |
ports: | |
- 3000:3000 | |
volumes: | |
- ./grafana/provisioning/datasources:/etc/grafana/provisioning/datasources | |
- grafana_data:/var/lib/grafana | |
networks: | |
- monitoring |
This file contains 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