Skip to content

Instantly share code, notes, and snippets.

@arraytools
Last active October 10, 2022 13:36
Show Gist options
  • Save arraytools/c953e04c3e876681c1e7f8579bdcac83 to your computer and use it in GitHub Desktop.
Save arraytools/c953e04c3e876681c1e7f8579bdcac83 to your computer and use it in GitHub Desktop.
Grafana using docker
version: '3.3'
services:
node-exporter:
image: quay.io/prometheus/node-exporter:latest
container_name: node_exporter
command:
- '--path.rootfs=/host'
network_mode: host
pid: host
restart: unless-stopped
volumes:
- '/:/host:ro,rslave'
prometheus:
container_name: prometheus
ports:
- '9090:9090'
volumes:
- '/home/brb/grafana/prometheus.yml:/etc/prometheus/prometheus.yml'
restart: unless-stopped
image: prom/prometheus
grafana:
container_name: grafana
ports:
- '3457:3000' #modify 3457 to your setup needs
restart: unless-stopped
image: grafana/grafana
global:
scrape_interval: 5s
external_labels:
monitor: 'node'
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['192.168.86.26:9090'] ## IP Address of the localhost.
- job_name: 'node-exporter'
static_configs:
- targets: ['192.168.86.26:9100'] ## IP Address of the localhost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment