Skip to content
Snippets Groups Projects
Commit bbbc1d54 authored by Éloïs's avatar Éloïs
Browse files

feat(docker): add compose with metrics

parent db18f612
No related branches found
No related tags found
No related merge requests found
global:
resolve_timeout: 1m
route:
receiver: 'mail-notifications'
receivers:
- name: 'mail-notifications'
email_configs:
- to: 'mydedicatednodealertaddress@domain.tld'
from: 'sender@domain.tld'
smarthost: 'smtp.server.tld:587'
auth_username: 'sender@domain.tld'
auth_identity: 'sender@domain.tld'
auth_password: 'yrymyemufalyjing'
send_resolved: true
version: "3.4"
services:
duniter-validator:
image: duniter/duniter-v2s:sha-142d4763
restart: unless-stopped
ports:
- 127.0.0.1:9615:9615
- 127.0.0.1:9933:9933
- 127.0.0.1:9944:9944
- 30333:30333
volumes:
- ./node.key:/etc/duniter/node.key
- duniter-validator-data:/var/lib/duniter/
environment:
- DUNITER_CHAIN_NAME=gdev
command:
- "--execution"
- "Wasm"
- "--node-key-file"
- "/etc/duniter/node-key"
- "--public-addr"
# SERVER_DOMAIN should be replaced by a domain name that point on your server
#
# The PEER_ID should be replaced by the output of this command:
# docker run --rm -it --entrypoint duniter -v $PWD:/var/lib/duniter/ duniter/duniter-v2s:sha-142d4763 key generate-node-key --file /var/lib/duniter/node.key
- "/dns/SERVER_DOMAIN/tcp/30333/p2p/PEER_ID"
- "--rpc-methods=Unsafe"
- "--validator"
- "--rpc-cors"
- "all"
- "--prometheus-external"
prometheus:
image: prom/prometheus:v2.30.3
restart: unless-stopped
ports:
- 9000:9090
volumes:
- ./prometheus:/etc/prometheus
- prometheus-data:/prometheus
command: --web.enable-lifecycle --config.file=/etc/prometheus/prometheus.yml
extra_hosts:
- "host.docker.internal:host-gateway"
alertmanager:
image: prom/alertmanager:v0.24.0
restart: unless-stopped
ports:
- 127.0.0.1:9093:9093
volumes:
- ./alertmanager:/etc/alertmanager
- alertmanager-data:/alertmanager
command: --config.file=/etc/alertmanager/alertmanager.yml
process-exporter:
image: ncabatoff/process-exporter
restart: unless-stopped
privileged: True
ports:
- 127.0.0.1:9256:9256
volumes:
- /proc:/host/proc
- ./process-exporter:/config
command: --procfs /host/proc -config.path /config/config.yml
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'
grafana:
image: grafana/grafana:8.5.4
restart: unless-stopped
ports:
- 127.0.0.1:3000:3000
volumes:
- ./grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
- grafana-data:/var/lib/grafana
environment:
- GF_INSTALL_PLUGINS=camptocamp-prometheus-alertmanager-datasource
volumes:
alertmanager-data:
duniter-validator-data:
grafana-data:
prometheus-data:
datasources:
- name: Prometheus
access: proxy
type: prometheus
url: http://prometheus:9090
isDefault: true
- name: Prometheus AlertManager
access: proxy
type: camptocamp-prometheus-alertmanager-datasource
url: http://alertmanager:9093
This diff is collapsed.
process_names:
- name: "{{.Comm}}"
cmdline:
- '.+'
groups:
- name: alert_rules
rules:
- alert: InstanceDown
expr: up == 0
for: 5m
labels:
severity: critical
annotations:
summary: "Instance $labels.instance down"
description: "[{{ $labels.instance }}] of job [{{ $labels.job }}] has been down for more than 1 minute."
- alert: HostHighCpuLoad
expr: 100 - (avg by(instance)(rate(node_cpu_seconds_total{mode="idle"}[2m])) * 100) > 80
for: 0m
labels:
severity: warning
annotations:
summary: Host high CPU load (instance bLd Kusama)
description: "CPU load is > 80%\n VALUE = {{ $value }}\n LABELS: {{ $labels }}"
rule_files:
- alert.yml
alerting:
alertmanagers:
- static_configs:
- targets:
- localhost:9093
scrape_configs:
- job_name: "prometheus"
scrape_interval: 5s
static_configs:
- targets: ["prometheus:9090"]
- job_name: "duniter-validator"
scrape_interval: 5s
static_configs:
- targets: ["duniter-validator:9615"]
- job_name: "node_exporter"
scrape_interval: 5s
static_configs:
- targets: ["host.docker.internal:9100"]
- job_name: "process-exporter"
scrape_interval: 5s
static_configs:
- targets: ["process-exporter:9256"]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment