feat(monitoring): Studio's alert webhook goes to the bot service (#10) #21

Manually merged
bryan merged 2 commits from n10-2-alert-webhook-pi-bots into main 2026-11-11 17:01:13 +00:00
Owner

Part of #10 (N10.2: the alert webhook pointed at the bot service).

What

Studio's services.monitoring.alertWebhook now posts every Alertmanager notification to the bot service's (pi-bots) studio-alerts route instead of Hermes's:

  • url: http://127.0.0.1:8645/webhooks/studio-alerts (was Hermes on 8644)
  • tokenHeader: X-Pi-Bots-Token (was X-Gitlab-Token)
  • tokenFile: ~/.secrets/pi-bots/webhooks/studio-alerts.token (made by pi-bots webhook token studio-alerts)

Steve posts each notification into the encrypted Studio Alerts room with no model turn. The payload is Alertmanager's own JSON, unchanged; the route (group_by, send_resolved) is unchanged. Email delivery is untouched.

Docs: modules/services/AGENTS.md (the webhook section and the monitoring row), monitoring.nix comments and option examples, README.

Tests

scripts/test_monitoring_alert_webhook.py (13): Studio's receiver names the new URL, header and token file; nothing of Hermes's route is left in the generated config; the activation preflight names the new token file; the real Alertmanager sends the token in X-Pi-Bots-Token without its newline and a version 4 body. With the old host file, 4 tests fail. test_dashy_status_api.py and test_pi_bots_service.py pass. darwin-rebuild build --flake .#studio builds.

After update-system

Alertmanager restarts with the new config. A test alert posted to Alertmanager arrives in Studio Alerts from Steve, and pi_bots_webhook_requests_total{webhook="studio-alerts",result="posted"} rises.

Review

A visible Pi reviewer approved with one should-fix (fseventsd-watchdog.nix's header still named Hermes as the alert path) and three nits (the pi-bots row's Ports column; group_by unpinned; a redundant test). The should-fix and the first two nits were fixed, with the group_by mutation now failing a test; approved on correction 1. Left: the activation preflight's condition is untested (pre-existing; it only warns).

Part of #10 (N10.2: the alert webhook pointed at the bot service). ## What Studio's `services.monitoring.alertWebhook` now posts every Alertmanager notification to the bot service's (pi-bots) `studio-alerts` route instead of Hermes's: - `url`: `http://127.0.0.1:8645/webhooks/studio-alerts` (was Hermes on 8644) - `tokenHeader`: `X-Pi-Bots-Token` (was `X-Gitlab-Token`) - `tokenFile`: `~/.secrets/pi-bots/webhooks/studio-alerts.token` (made by `pi-bots webhook token studio-alerts`) Steve posts each notification into the encrypted Studio Alerts room with no model turn. The payload is Alertmanager's own JSON, unchanged; the route (`group_by`, `send_resolved`) is unchanged. Email delivery is untouched. Docs: `modules/services/AGENTS.md` (the webhook section and the monitoring row), `monitoring.nix` comments and option examples, README. ## Tests `scripts/test_monitoring_alert_webhook.py` (13): Studio's receiver names the new URL, header and token file; nothing of Hermes's route is left in the generated config; the activation preflight names the new token file; the real Alertmanager sends the token in `X-Pi-Bots-Token` without its newline and a version 4 body. With the old host file, 4 tests fail. `test_dashy_status_api.py` and `test_pi_bots_service.py` pass. `darwin-rebuild build --flake .#studio` builds. ## After `update-system` Alertmanager restarts with the new config. A test alert posted to Alertmanager arrives in Studio Alerts from Steve, and `pi_bots_webhook_requests_total{webhook="studio-alerts",result="posted"}` rises. ## Review A visible Pi reviewer approved with one should-fix (`fseventsd-watchdog.nix`'s header still named Hermes as the alert path) and three nits (the `pi-bots` row's Ports column; `group_by` unpinned; a redundant test). The should-fix and the first two nits were fixed, with the `group_by` mutation now failing a test; approved on correction 1. Left: the activation preflight's condition is untested (pre-existing; it only warns).
Alertmanager's webhook integration on Studio now posts to pi-bots'
studio-alerts route (127.0.0.1:8645, X-Pi-Bots-Token), where Steve posts
each notification into the Studio Alerts room with no model turn. It
replaces Hermes's route. Tests pin the new wiring and that nothing of
Hermes's route is left; docs follow.
bryan manually merged commit 075ccf07ee into main 2026-11-11 17:01:13 +00:00
Sign in to join this conversation.
No reviewers
No labels
ready-for-agent
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bryan/nix-configs!21
No description provided.