feat: add CPU load alert, lower disk/RAM thresholds (SCALE-04)

- Add CpuLoad alert rule: fires when 5min load > 2x core count
- Lower disk usage alert from 90% to 80%
- Lower RAM usage alert from 90% to 80%
- Add num_cpus dependency for runtime core detection

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-14 03:29:29 +00:00
parent 224a0db76c
commit 8302b0b357
3 changed files with 33 additions and 4 deletions

View File

@@ -319,7 +319,7 @@ Every test must pass **10 consecutive times** from BOTH .228→.198 AND .198→.
- [x] **SCALE-03** — Added app tier system in backend. `get_app_tier()` in docker_packages.rs classifies apps as "core" (Bitcoin+LND+Electrs+Mempool+BTCPay+DWN+FileBrowser), "recommended" (Fedimint+Grafana+Vaultwarden+Kuma+SearXNG+Tailscale+Portainer), or "optional" (everything else). Tier field added to Manifest struct in data_model.rs, exposed via WebSocket package data to frontend.
- [ ] **SCALE-04** — Add resource monitoring alerts for scale limits. Alert when: total container memory > 80% of system RAM, CPU load > 2x core count sustained for 5 min, disk > 80%. These proactive alerts prevent scale-related failures. **Acceptance**: Alerts fire at correct thresholds. Tested on both nodes.
- [x] **SCALE-04** — Added resource monitoring alerts in monitoring/mod.rs. Lowered disk threshold to 80% (was 90%). Lowered RAM threshold to 80% (was 90%). Added CpuLoad alert type: fires when 5-min load average > threshold × core count (default threshold: 2.0). Uses num_cpus crate for core detection.
### Sprint 15: Automated Fleet Testing