Deployed prometheus/grafana
This commit is contained in:
12
boilerplates/grafana/compose.yaml
Normal file
12
boilerplates/grafana/compose.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
services:
|
||||
grafana:
|
||||
image: docker.io/grafana/grafana-oss:12.3.3
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3000:3000"
|
||||
volumes:
|
||||
- grafana_data:/var/lib/grafana
|
||||
|
||||
volumes:
|
||||
grafana_data:
|
||||
driver: local
|
||||
105
boilerplates/monitoring/compose.yaml
Normal file
105
boilerplates/monitoring/compose.yaml
Normal file
@@ -0,0 +1,105 @@
|
||||
---
|
||||
# ------------------------------------------------------------------------------
|
||||
# FILE: boilerplates/monitoring/compose.yaml
|
||||
# DESCRIPTION: Combined Prometheus + Grafana + Alertmanager + Node Exporter
|
||||
# stack for cinderella-castle (10.1.71.31)
|
||||
#
|
||||
# Generated from:
|
||||
# boilerplates/prometheus/compose.yaml (prom/prometheus:v3.9.1)
|
||||
# boilerplates/grafana/compose.yaml (grafana/grafana-oss:12.3.3)
|
||||
#
|
||||
# Prometheus TSDB on dedicated second disk mounted at /var/lib/prometheus.
|
||||
# Grafana data on named Docker volume.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
services:
|
||||
|
||||
prometheus:
|
||||
image: docker.io/prom/prometheus:v3.9.1
|
||||
container_name: prometheus
|
||||
restart: unless-stopped
|
||||
user: "65534:65534"
|
||||
command:
|
||||
- --config.file=/etc/prometheus/prometheus.yaml
|
||||
- --storage.tsdb.path=/prometheus
|
||||
- --storage.tsdb.retention.time=${PROMETHEUS_RETENTION_TIME:-15d}
|
||||
- --storage.tsdb.retention.size=${PROMETHEUS_RETENTION_SIZE:-58GB}
|
||||
- --web.enable-lifecycle
|
||||
ports:
|
||||
- "127.0.0.1:9090:9090"
|
||||
volumes:
|
||||
- /opt/docker/monitoring/prometheus/prometheus.yaml:/etc/prometheus/prometheus.yaml:ro
|
||||
- /var/lib/prometheus:/prometheus
|
||||
networks:
|
||||
- monitoring
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--spider", "-q", "http://localhost:9090/-/healthy"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
|
||||
grafana:
|
||||
image: docker.io/grafana/grafana-oss:12.3.3
|
||||
container_name: grafana
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- GF_SECURITY_ADMIN_USER=${GRAFANA_ADMIN_USER:-admin}
|
||||
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD}
|
||||
- GF_SERVER_ROOT_URL=https://grafana.local.mk-labs.cloud
|
||||
ports:
|
||||
- "3000:3000"
|
||||
volumes:
|
||||
- grafana_data:/var/lib/grafana
|
||||
- /opt/docker/monitoring/grafana/datasource.yml:/etc/grafana/provisioning/datasources/datasource.yml:ro
|
||||
networks:
|
||||
- monitoring
|
||||
depends_on:
|
||||
prometheus:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--spider", "-q", "http://localhost:3000/api/health"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 15s
|
||||
|
||||
alertmanager:
|
||||
image: docker.io/prom/alertmanager:latest
|
||||
container_name: alertmanager
|
||||
restart: unless-stopped
|
||||
command:
|
||||
- --config.file=/etc/alertmanager/alertmanager.yml
|
||||
- --storage.path=/alertmanager
|
||||
ports:
|
||||
- "127.0.0.1:9093:9093"
|
||||
volumes:
|
||||
- /opt/docker/monitoring/alertmanager/alertmanager.yml:/etc/alertmanager/alertmanager.yml:ro
|
||||
- alertmanager_data:/alertmanager
|
||||
networks:
|
||||
- monitoring
|
||||
|
||||
node-exporter:
|
||||
image: docker.io/prom/node-exporter:latest
|
||||
container_name: node-exporter
|
||||
restart: unless-stopped
|
||||
pid: host
|
||||
command:
|
||||
- --path.rootfs=/host
|
||||
ports:
|
||||
- "9100:9100"
|
||||
volumes:
|
||||
- /:/host:ro,rslave
|
||||
networks:
|
||||
- monitoring
|
||||
|
||||
networks:
|
||||
monitoring:
|
||||
driver: bridge
|
||||
name: monitoring
|
||||
|
||||
volumes:
|
||||
grafana_data:
|
||||
driver: local
|
||||
alertmanager_data:
|
||||
driver: local
|
||||
17
boilerplates/prometheus/compose.yaml
Normal file
17
boilerplates/prometheus/compose.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
services:
|
||||
prometheus:
|
||||
image: docker.io/prom/prometheus:v3.9.1
|
||||
restart: unless-stopped
|
||||
command:
|
||||
- --config.file=/etc/prometheus/prometheus.yaml
|
||||
- --storage.tsdb.retention.time=15d
|
||||
ports:
|
||||
- "9090:9090"
|
||||
volumes:
|
||||
- prometheus_data:/prometheus
|
||||
- ./config/prometheus.yaml:/etc/prometheus/prometheus.yaml:ro
|
||||
|
||||
volumes:
|
||||
prometheus_data:
|
||||
driver: local
|
||||
28
boilerplates/prometheus/config/prometheus.yaml
Normal file
28
boilerplates/prometheus/config/prometheus.yaml
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
global:
|
||||
scrape_interval: 15s # By default, scrape targets every 15 seconds.
|
||||
|
||||
# Attach these labels to any time series or alerts when communicating with
|
||||
# external systems (federation, remote storage, Alertmanager).
|
||||
# external_labels:
|
||||
# monitor: 'codelab-monitor'
|
||||
|
||||
# A scrape configuration containing exactly one endpoint to scrape:
|
||||
# Here it's Prometheus itself.
|
||||
scrape_configs:
|
||||
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
|
||||
- job_name: 'prometheus'
|
||||
# Override the global default and scrape targets from this job every 5 seconds.
|
||||
scrape_interval: 5s
|
||||
static_configs:
|
||||
- targets: ['localhost:9090']
|
||||
|
||||
# Example job for node_exporter
|
||||
# - job_name: 'node_exporter'
|
||||
# static_configs:
|
||||
# - targets: ['node_exporter:9100']
|
||||
|
||||
# Example job for cadvisor
|
||||
# - job_name: 'cadvisor'
|
||||
# static_configs:
|
||||
# - targets: ['cadvisor:8080']
|
||||
21
boilerplates/traefik/dynamic/grafana.yml
Normal file
21
boilerplates/traefik/dynamic/grafana.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
# ------------------------------------------------------------------------------
|
||||
# FILE: boilerplates/traefik/dynamic/grafana.yml
|
||||
# DESCRIPTION: Traefik dynamic config routing grafana.local.mk-labs.cloud
|
||||
# to Grafana on cinderella-castle (10.1.71.31:3000)
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
http:
|
||||
routers:
|
||||
grafana:
|
||||
rule: "Host(`grafana.local.mk-labs.cloud`)"
|
||||
entryPoints:
|
||||
- websecure
|
||||
tls:
|
||||
certResolver: cloudflare
|
||||
service: grafana
|
||||
|
||||
services:
|
||||
grafana:
|
||||
loadBalancer:
|
||||
servers:
|
||||
- url: "http://10.1.71.31:3000"
|
||||
Reference in New Issue
Block a user