Initial: Prometheus + Grafana monitoring stack

- Prometheus with 9 scrape targets
- Grafana with Home Server Overview dashboard
- Exporters: node_exporter, cadvisor, postgres_exporter (x3), qbittorrent
- Traefik and Gitea metrics enabled
This commit is contained in:
2026-07-31 15:24:11 +03:00
commit 82f3dae6ab
6 changed files with 377 additions and 0 deletions
+140
View File
@@ -0,0 +1,140 @@
name: monitoring
services:
prometheus:
image: prom/prometheus:latest
container_name: prometheus
restart: always
user: "0:0"
ports:
- "127.0.0.1:9090:9090"
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--web.enable-lifecycle'
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
networks:
- monitoring
- traefik_proxy
extra_hosts:
- 'host.docker.internal:192.168.1.80'
grafana:
image: grafana/grafana:latest
container_name: grafana
restart: always
user: "0:0"
environment:
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD}
- GF_SERVER_ROOT_URL=https://grafana.kzbrd.ru
- GF_INSTALL_PLUGINS=grafana-piechart-panel
volumes:
- grafana_data:/var/lib/grafana
- ./grafana/provisioning:/etc/grafana/provisioning:ro
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik_proxy"
- "traefik.http.routers.grafana.rule=Host(`grafana.kzbrd.ru`)"
- "traefik.http.routers.grafana.entrypoints=websecure"
- "traefik.http.routers.grafana.tls=true"
- "traefik.http.routers.grafana.tls.certresolver=myresolver"
- "traefik.http.services.grafana.loadbalancer.server.port=3000"
- "com.centurylinklabs.watchtower.enable=true"
networks:
- monitoring
- traefik_proxy
node_exporter:
image: prom/node-exporter:latest
container_name: node_exporter
restart: always
command:
- '--path.rootfs=/host'
pid: host
volumes:
- /:/host:ro,rslave
networks:
- monitoring
cadvisor:
image: gcr.io/cadvisor/cadvisor:latest
container_name: cadvisor
restart: always
privileged: true
command:
- '--port=8081'
devices:
- /dev/kmsg
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /dev/disk/:/dev/disk:ro
networks:
- monitoring
postgres_exporter_pgvector:
image: prometheuscommunity/postgres-exporter:latest
container_name: postgres_exporter_pgvector
restart: always
environment:
- DATA_SOURCE_NAME=postgresql://postgres:${PGVECTOR_PASSWORD}@host.docker.internal:5432/postgres?sslmode=disable
networks:
- monitoring
extra_hosts:
- 'host.docker.internal:192.168.1.80'
postgres_exporter_langfuse:
image: prometheuscommunity/postgres-exporter:latest
container_name: postgres_exporter_langfuse
restart: always
command:
- '--web.listen-address=:9188'
environment:
- DATA_SOURCE_NAME=postgresql://postgres:${LANGFUSE_DB_PASSWORD}@langfuse-postgres-1:5432/langfuse?sslmode=disable
networks:
- monitoring
- langfuse_default
postgres_exporter_mcpjungle:
image: prometheuscommunity/postgres-exporter:latest
container_name: postgres_exporter_mcpjungle
restart: always
command:
- '--web.listen-address=:9189'
environment:
- DATA_SOURCE_NAME=postgresql://mcpjungle:${MCPJUNGLE_DB_PASSWORD}@mcpjungle-db:5432/mcpjungle?sslmode=disable
networks:
- monitoring
- mcpjungle_internal
qbittorrent_exporter:
image: ghcr.io/esanchezm/prometheus-qbittorrent-exporter:latest
container_name: qbittorrent_exporter
restart: always
environment:
- QBITTORRENT_HOST=qbittorrent
- QBITTORRENT_PORT=8080
- QBITTORRENT_API_KEY=${QBIT_PASSWORD}
networks:
- monitoring
- traefik_proxy
networks:
monitoring:
driver: bridge
traefik_proxy:
external: true
langfuse_default:
external: true
mcpjungle_internal:
external: true
volumes:
prometheus_data:
grafana_data: