Skip to content

Commit fa8fd04

Browse files
committed
chore(monitoring): add Prometheus/Grafana docker-compose stack
Scrapes electrs metrics from a configurable target (default 10.9.68.11:4224). Target is set via monitoring/.env and substituted into the Prometheus config at container startup with sed. Includes a RocksDB dashboard covering: write stalls, L0 file count, files per level, pending compaction, memtable pressure, block cache usage, SST file sizes, key count, and background errors.
1 parent 19ab74c commit fa8fd04

6 files changed

Lines changed: 603 additions & 0 deletions

File tree

‎monitoring/.env‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ELECTRS_TARGET=10.9.68.11:4224

‎monitoring/docker-compose.yml‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
services:
2+
prometheus:
3+
image: prom/prometheus:latest
4+
ports:
5+
- "9090:9090"
6+
volumes:
7+
- ./prometheus:/etc/prometheus:ro
8+
- prometheus_data:/prometheus
9+
environment:
10+
- ELECTRS_TARGET=${ELECTRS_TARGET}
11+
entrypoint:
12+
- /bin/sh
13+
- -c
14+
- |
15+
sed "s|__ELECTRS_TARGET__|$$ELECTRS_TARGET|g" /etc/prometheus/prometheus.yml > /tmp/prometheus.yml
16+
exec /bin/prometheus \
17+
--config.file=/tmp/prometheus.yml \
18+
--storage.tsdb.path=/prometheus \
19+
--storage.tsdb.retention.time=30d
20+
restart: unless-stopped
21+
22+
grafana:
23+
image: grafana/grafana:latest
24+
ports:
25+
- "3000:3000"
26+
volumes:
27+
- ./grafana/provisioning:/etc/grafana/provisioning:ro
28+
- ./grafana/dashboards:/var/lib/grafana/dashboards:ro
29+
- grafana_data:/var/lib/grafana
30+
environment:
31+
- GF_SECURITY_ADMIN_PASSWORD=admin
32+
- GF_AUTH_ANONYMOUS_ENABLED=true
33+
- GF_AUTH_ANONYMOUS_ORG_ROLE=Viewer
34+
depends_on:
35+
- prometheus
36+
restart: unless-stopped
37+
38+
volumes:
39+
prometheus_data:
40+
grafana_data:

0 commit comments

Comments
 (0)