Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Grafana + Prometheus template.
version: '3'
volumes:
prometheus_data: {}
grafana_data: {}
services:
# Prometheus backend.
prometheus:
restart: always
image: prom/prometheus
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
ports:
- '9090:9090'
# Visualization.
grafana:
restart: always
image: grafana/grafana
volumes:
- grafana_data:/var/lib/grafana
environment:
GF_SECURITY_ADMIN_PASSWORD: defaultpassword
depends_on:
- prometheus
ports:
- '3000:3000'
global:
scrape_interval: 1s
external_labels:
monitor: 'my-monitor'
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
- job_name: 'environ-sensor'
static_configs:
- targets: ['192.168.1.16:80']
labels:
group: 'environment-sensors'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.