Make Prometheus the only service monitor #10

Open
opened 2026-11-10 02:51:42 +00:00 by bryan · 1 comment
Owner

Problem / Motivation

Two systems watch the Studio's services. A Hermes job polls 15 pages every 5 minutes and alerts in Matrix. Prometheus probes five and alerts by email and, through a Hermes webhook, in Matrix. Four services are checked by both. Hermes is being retired.

Proposed behavior

Prometheus is the only monitor and owns all alerting. Scripts that measure or repair something keep running and report to Prometheus through metrics files.

Scope

In scope

  • Probes for the services only the Hermes script checks: Jellyfin, Dashy, Grafana Alloy, Artifact Shelf, SGG pre-review, Claude usage.
  • services.monitoring.alertWebhook pointing at the bot service, so Steve posts to Studio Alerts.
  • The status dots on Studio Home reading from Prometheus instead of ~/.local/state/hermes/studio-service-watchdog.json.
  • Alert rules for the SGG preview watchdog and the OpenCode Go usage check, once they write metrics files.

Out of scope

  • A second monitoring tool, and an outside heartbeat for the Studio. Bryan accepts that gap.

Implementation hints

  • The Hermes script checks response contents, not just status. The prober can match response text; this is not yet set up.
  • Related: #8.
  • The webhook target comes from bryan/dotfiles-workspace#31.

Acceptance criteria

  • Stopping any one of the listed services raises an alert in Studio Alerts and by email.
  • The status dots work with the Hermes job disabled.
  • The Hermes job "Monitor Studio services" is disabled.

Decision record: vault/decisions/2026-11-09-pi-as-primary-harness.md in bryan/dotfiles-workspace (commit 321ed03).

Parent: bryan/dotfiles-workspace#30.

Pieces

Each piece is one Pi session. The full breakdown and the loop's rules are in vault/plans/pi-primary-harness-work-breakdown.md in bryan/dotfiles-workspace.

  • N10.1 (nix-configs; Loop; rebuild batched): Probes for Jellyfin, Dashy, Grafana Alloy, Artifact Shelf, SGG pre-review, Claude usage, with response matching. Done when: merged; the host builds. Done 2026-11-10: 8dbe59c (#13); live after the next update-system.
  • N10.2 (nix-configs; Loop; rebuild batched): Alert webhook pointed at the bot service. Done when: merged; the host builds. Done 2026-11-11: 075ccf0 (#21); Studio builds; Alertmanager's webhook goes to the bot service, where Steve posts into Studio Alerts. Live 2026-11-11 after update-system: a test alert's firing and resolved notices were each posted by Steve, with no failed webhook or email notification.
  • N10.3 (nix-configs; Loop; rebuild batched): Studio Home status dots read from Prometheus. Done when: dots work with the Hermes monitor job disabled. Done 2026-11-10: dd9824a (#16); live after update-system, and every dot still green 16 minutes after the Hermes job was paused.
  • N10.4 (nix-configs; Loop; rebuild batched): Alert rules for the preview watchdog's metrics. Done when: merged; the host builds. Done 2026-11-11: c861ef1 (#22); Studio builds; the SGG preview watchdog's rules (silent, blocked, a preview needing attention) beside the bot service's job clock and failed-job rules. Live after the next update-system.
  • N10.5 (nix-configs; Loop; rebuild batched): Alert rules for NAS storage health. Done when: a rule fires on a storage fault. Done 2026-11-10: ae5cfaa (#14); rules proved with promtool test rules; live after the next update-system.
## Problem / Motivation Two systems watch the Studio's services. A Hermes job polls 15 pages every 5 minutes and alerts in Matrix. Prometheus probes five and alerts by email and, through a Hermes webhook, in Matrix. Four services are checked by both. Hermes is being retired. ## Proposed behavior Prometheus is the only monitor and owns all alerting. Scripts that measure or repair something keep running and report to Prometheus through metrics files. ## Scope ### In scope - Probes for the services only the Hermes script checks: Jellyfin, Dashy, Grafana Alloy, Artifact Shelf, SGG pre-review, Claude usage. - `services.monitoring.alertWebhook` pointing at the bot service, so Steve posts to Studio Alerts. - The status dots on Studio Home reading from Prometheus instead of `~/.local/state/hermes/studio-service-watchdog.json`. - Alert rules for the SGG preview watchdog and the OpenCode Go usage check, once they write metrics files. ### Out of scope - A second monitoring tool, and an outside heartbeat for the Studio. Bryan accepts that gap. ## Implementation hints - The Hermes script checks response contents, not just status. The prober can match response text; this is not yet set up. - Related: #8. - The webhook target comes from bryan/dotfiles-workspace#31. ## Acceptance criteria - [ ] Stopping any one of the listed services raises an alert in Studio Alerts and by email. - [x] The status dots work with the Hermes job disabled. - [x] The Hermes job "Monitor Studio services" is disabled. Decision record: `vault/decisions/2026-11-09-pi-as-primary-harness.md` in `bryan/dotfiles-workspace` (commit 321ed03). Parent: bryan/dotfiles-workspace#30. ## Pieces Each piece is one Pi session. The full breakdown and the loop's rules are in `vault/plans/pi-primary-harness-work-breakdown.md` in `bryan/dotfiles-workspace`. - [x] **N10.1** (nix-configs; Loop; rebuild batched): Probes for Jellyfin, Dashy, Grafana Alloy, Artifact Shelf, SGG pre-review, Claude usage, with response matching. Done when: merged; the host builds. Done 2026-11-10: `8dbe59c` (#13); live after the next `update-system`. - [x] **N10.2** (nix-configs; Loop; rebuild batched): Alert webhook pointed at the bot service. Done when: merged; the host builds. Done 2026-11-11: `075ccf0` (#21); Studio builds; Alertmanager's webhook goes to the bot service, where Steve posts into Studio Alerts. Live 2026-11-11 after `update-system`: a test alert's firing and resolved notices were each posted by Steve, with no failed webhook or email notification. - [x] **N10.3** (nix-configs; Loop; rebuild batched): Studio Home status dots read from Prometheus. Done when: dots work with the Hermes monitor job disabled. Done 2026-11-10: `dd9824a` (#16); live after `update-system`, and every dot still green 16 minutes after the Hermes job was paused. - [x] **N10.4** (nix-configs; Loop; rebuild batched): Alert rules for the preview watchdog's metrics. Done when: merged; the host builds. Done 2026-11-11: `c861ef1` (#22); Studio builds; the SGG preview watchdog's rules (silent, blocked, a preview needing attention) beside the bot service's job clock and failed-job rules. Live after the next `update-system`. - [x] **N10.5** (nix-configs; Loop; rebuild batched): Alert rules for NAS storage health. Done when: a rule fires on a storage fault. Done 2026-11-10: `ae5cfaa` (#14); rules proved with `promtool test rules`; live after the next `update-system`.
Author
Owner

Follow-up of the status-dots change (#16): #19 (392e74a) lists Studio's Pi Durable Dashy links only while their services are enabled and have a Serve port, which is when their probes exist. That fixes the 5 scripts/test_pi_durable_module.py failures on main since dd9824a. Studio's built system is unchanged (same store path), so no rebuild is needed for it.

Follow-up of the status-dots change (#16): #19 (`392e74a`) lists Studio's Pi Durable Dashy links only while their services are enabled and have a Serve port, which is when their probes exist. That fixes the 5 `scripts/test_pi_durable_module.py` failures on main since `dd9824a`. Studio's built system is unchanged (same store path), so no rebuild is needed for it.
Sign in to join this conversation.
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#10
No description provided.