feat(monitoring): deploy Prometheus + Grafana stack via Docker
- prometheus.yml: scrapes node, postgres, redis, nexus-pos, nexus-quart - docker-compose.monitoring.yml: Prometheus, Grafana, node-exporter, postgres-exporter, redis-exporter - Grafana auto-provisions Prometheus datasource - Access: Grafana :3001 (admin/nexus2026), Prometheus :9090
This commit is contained in:
60
docker/docker-compose.monitoring.yml
Normal file
60
docker/docker-compose.monitoring.yml
Normal file
@@ -0,0 +1,60 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
prometheus:
|
||||
image: prom/prometheus:v2.51.0
|
||||
container_name: nexus-prometheus
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "9090:9090"
|
||||
volumes:
|
||||
- ./prometheus:/etc/prometheus
|
||||
- prometheus-data:/prometheus
|
||||
command:
|
||||
- '--config.file=/etc/prometheus/prometheus.yml'
|
||||
- '--storage.tsdb.path=/prometheus'
|
||||
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
|
||||
- '--web.console.templates=/usr/share/prometheus/consoles'
|
||||
- '--web.enable-lifecycle'
|
||||
|
||||
grafana:
|
||||
image: grafana/grafana:10.4.1
|
||||
container_name: nexus-grafana
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3001:3000"
|
||||
volumes:
|
||||
- grafana-data:/var/lib/grafana
|
||||
- ./grafana/provisioning:/etc/grafana/provisioning
|
||||
environment:
|
||||
- GF_SECURITY_ADMIN_USER=admin
|
||||
- GF_SECURITY_ADMIN_PASSWORD=nexus2026
|
||||
- GF_USERS_ALLOW_SIGN_UP=false
|
||||
|
||||
node-exporter:
|
||||
image: prom/node-exporter:v1.7.0
|
||||
container_name: nexus-node-exporter
|
||||
restart: unless-stopped
|
||||
network_mode: host
|
||||
|
||||
postgres-exporter:
|
||||
image: prometheuscommunity/postgres-exporter:v0.15.0
|
||||
container_name: nexus-postgres-exporter
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
DATA_SOURCE_NAME: "postgresql://postgres@172.17.0.1:5432/nexus_autoparts?sslmode=disable"
|
||||
ports:
|
||||
- "9187:9187"
|
||||
|
||||
redis-exporter:
|
||||
image: oliver006/redis_exporter:v1.58.0
|
||||
container_name: nexus-redis-exporter
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
REDIS_ADDR: "redis://172.17.0.1:6379"
|
||||
ports:
|
||||
- "9121:9121"
|
||||
|
||||
volumes:
|
||||
prometheus-data:
|
||||
grafana-data:
|
||||
Reference in New Issue
Block a user