Skip to content

Instantly share code, notes, and snippets.

@jhx0
Last active October 11, 2022 15:31
Show Gist options
  • Select an option

  • Save jhx0/27a17580328873c6424663d0bd21d2a4 to your computer and use it in GitHub Desktop.

Select an option

Save jhx0/27a17580328873c6424663d0bd21d2a4 to your computer and use it in GitHub Desktop.
Grafana, Prometheus, Node-Exporter - Docker Stack
version: '3.8'
volumes:
prometheus_data: {}
grafana_data: {}
services:
node-exporter:
image: prom/node-exporter:latest
container_name: local-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
ports:
- 9100:9100
prometheus:
image: prom/prometheus:latest
container_name: local-prometheus
restart: unless-stopped
volumes:
- ./config/:/etc/prometheus/
- 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
ports:
- 9090:9090
grafana:
image: grafana/grafana:latest
container_name: local-grafana
restart: unless-stopped
volumes:
- grafana_data:/var/lib/grafana
ports:
- 10000:3000
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