Skip to content

Instantly share code, notes, and snippets.

@zettalyst
Created June 26, 2024 06:33
Show Gist options
  • Select an option

  • Save zettalyst/b3d6af87d2ecf5b6fcc1c706ab7cf4dd to your computer and use it in GitHub Desktop.

Select an option

Save zettalyst/b3d6af87d2ecf5b6fcc1c706ab7cf4dd to your computer and use it in GitHub Desktop.
services:
prometheus:
image: prom/prometheus:v2.52.0
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
command:
- '--config.file=/etc/prometheus/prometheus.yml'
ports:
- '9090:9090'
node_exporter:
image: prom/node-exporter:v1.8.0
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'
grafana:
image: grafana/grafana-oss:10.4.2
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin # Set the admin password
- GF_USERS_ALLOW_SIGN_UP=false
ports:
- '3000:3000'
depends_on:
- prometheus
global:
scrape_interval: 15s
scrape_configs:
- job_name: 'prometheus' # prometheus
static_configs:
- targets: ['localhost:9090']
- job_name: 'node' # node_exporter
static_configs:
- targets: ['node_exporter:9100']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment