Add dialog summary: 2026-06-22 Grafana monitoring stack setup

This commit is contained in:
post 2026-06-22 20:55:32 +00:00
parent 0392ef330e
commit 26e5719af2

View file

@ -0,0 +1,63 @@
# 2026-06-22 — Grafana Monitoring Stack Setup
**Session type:** Infrastructure deployment
**Duration:** ~3 hours
**Result:** ✅ Full monitoring stack deployed, 21/21 targets UP
## What was done
### NVR Debug Mode (continuation from previous session)
- NVR pipeline was already fixed (n8n bodyParameters bug resolved)
- Added "debug mode": ALL person detections sent to Telegram
- Known: photo + "✅ Name" caption (via send_known_photo in face-trainer)
- Unknown: photo + inline [Name/Stranger] buttons (existing send_alert)
- n8n workflow updated: removed IF node, always POST /notify with has_unknown + known_names
### Monitoring Phase 1 — Core Stack on Docker Host
Deployed to 192.168.170.30:/opt/monitoring/:
- Prometheus :9090 (30d retention)
- Grafana :3001 (admin/cityweek) — port 3000 taken by Forgejo
- Alertmanager :9093 — native Telegram alerts (no bridge)
- Loki :3100 + Promtail
- cAdvisor :8082 (moved from 8080, conflict with existing service)
- Blackbox :9115
**Issue 1:** cAdvisor crashed with `inotify_init: too many open files`
Fix: increased `fs.inotify.max_user_instances=8192`, `max_user_watches=1048576`
**Issue 2:** nvidia_gpu_exporter panic: invalid metric name with spaces in newer driver
Fix: textfile collector — Python script reads nvidia-smi CSV, writes .prom file
### Monitoring Phase 2 — All Nodes
- node_exporter: systemd binary on Proxmox, CT100, CT102, CT200
- node_exporter: Docker on qore (with textfile GPU metrics)
- node_exporter: TrueNAS — OS is read-only, binary at /mnt/datapool/prometheus/
- pve_exporter v3.9: pip install on Proxmox (--break-system-packages), v3 uses --config.file=
- Proxmox SSH: requires sshpass -p "cityweek" (no key auth)
- CTs 100/102/200: access via `pct exec` from Proxmox (no direct SSH)
- TrueNAS download: GitHub unreachable, binary copied via docker host
## Problems Encountered and Solved
| Problem | Solution |
|---------|----------|
| git amend merged monitoring into NVR commit | git reset --mixed + stash + pull + new commit |
| Telegram bot token in git | replaced with placeholder before push |
| cAdvisor inotify limit | sysctl increase |
| nvidia_gpu_exporter crash | textfile collector with Python script |
| pve_exporter v3 syntax changed | --config.file= flag |
| TrueNAS GitHub unreachable | scp binary via docker host |
| TrueNAS OS read-only | binary at /mnt/datapool/prometheus/ |
| CT100/102 no SSH key | access via Proxmox pct exec |
## Final State
- 21/21 Prometheus targets UP
- GPU metrics flowing (temp=40°C, VRAM 36/49GB used, power 23W)
- Proxmox VMs/CTs metrics via pve_exporter
- 8 HTTP + 3 TCP blackbox probes all UP
- Loki collecting Docker logs
- Alert rules: 10 rules covering disk/CPU/RAM/GPU/containers/services