feat(monitoring): content probes for six Studio services (#10) #13

Manually merged
bryan merged 2 commits from n10-1-content-probes into main 2026-11-10 16:10:16 +00:00
Owner

Part of #10 (piece N10.1): Prometheus probes for the six services that until now only the Hermes watchdog checked, matching each response's content as well as its status.

What changes

  • services.monitoring.blackbox.contentProbes.<name> = { url; bodyMatches; }: a probe that is healthy only on a 2xx whose body matches a Go regular expression. Each gets its own blackbox module and is a target in the existing blackbox job, labelled probe="<name>", so ServiceDown and the Service Health dashboard cover it without new rules.
  • The probes come from the modules that own the services: Dashy (<title>Dashy</title>), Artifact Shelf (its generator marker), the SGG pre-review page and the Claude usage sampler (their /metrics counters), Grafana Alloy (monitoring.nix), and Jellyfin (hosts/studio.nix, beside its cask). Names match the Hermes watchdog's, which Dashy's status dots use.
  • Assertions: names are letters, digits, spaces and dashes and stay distinct; a URL is probed once, in targets or contentProbes.
  • modules/services/AGENTS.md documents the option.

Checks

  • python3 scripts/test_monitoring_content_probes.py: Studio's wiring, the refusals, promtool check config, and the real blackbox_exporter with Studio's generated modules against a stand-in endpoint: each healthy body passes, a 200 with the wrong body fails, a 500 with the right body fails. With the match replaced by .*, the wrong-body cases fail.
  • The six probes run against the live services through the built exporter: all probe_success 1.
  • test_monitoring_alert_webhook, test_studio_listener_exposure, test_dashy_status_api, test_artifact_shelf, test_pi_durable_module, test_monitoring_boot_safety, test_fseventsd_watchdog pass; test_monitoring_content_probes 13/13 on the final head.
  • darwin-rebuild build --flake .#studio builds; mbp and a6mbp evaluate.

Live after the next update-system.

Review

Independent read-only Pi review on 81268ff: approve, no blocking or should-fix findings. Fixed from its nits: tests now pin Jellyfin's anchors, each probe's enable gating, and that the three modules evaluate on a host without monitoring (each proved by a mutation). Left as is: Dashy's probe URL assumes an IPv4 host, as its listener already does; the URL-uniqueness assertion compares exact strings. Deferred to N10.2/N10.3: alert text and the dashboard naming probes by probe rather than URL.

Part of #10 (piece N10.1): Prometheus probes for the six services that until now only the Hermes watchdog checked, matching each response's content as well as its status. ## What changes - `services.monitoring.blackbox.contentProbes.<name> = { url; bodyMatches; }`: a probe that is healthy only on a 2xx whose body matches a Go regular expression. Each gets its own blackbox module and is a target in the existing `blackbox` job, labelled `probe="<name>"`, so `ServiceDown` and the Service Health dashboard cover it without new rules. - The probes come from the modules that own the services: Dashy (`<title>Dashy</title>`), Artifact Shelf (its generator marker), the SGG pre-review page and the Claude usage sampler (their `/metrics` counters), Grafana Alloy (`monitoring.nix`), and Jellyfin (`hosts/studio.nix`, beside its cask). Names match the Hermes watchdog's, which Dashy's status dots use. - Assertions: names are letters, digits, spaces and dashes and stay distinct; a URL is probed once, in `targets` or `contentProbes`. - `modules/services/AGENTS.md` documents the option. ## Checks - `python3 scripts/test_monitoring_content_probes.py`: Studio's wiring, the refusals, `promtool check config`, and the real blackbox_exporter with Studio's generated modules against a stand-in endpoint: each healthy body passes, a 200 with the wrong body fails, a 500 with the right body fails. With the match replaced by `.*`, the wrong-body cases fail. - The six probes run against the live services through the built exporter: all `probe_success 1`. - `test_monitoring_alert_webhook`, `test_studio_listener_exposure`, `test_dashy_status_api`, `test_artifact_shelf`, `test_pi_durable_module`, `test_monitoring_boot_safety`, `test_fseventsd_watchdog` pass; `test_monitoring_content_probes` 13/13 on the final head. - `darwin-rebuild build --flake .#studio` builds; `mbp` and `a6mbp` evaluate. Live after the next `update-system`. ## Review Independent read-only Pi review on `81268ff`: approve, no blocking or should-fix findings. Fixed from its nits: tests now pin Jellyfin's anchors, each probe's enable gating, and that the three modules evaluate on a host without monitoring (each proved by a mutation). Left as is: Dashy's probe URL assumes an IPv4 host, as its listener already does; the URL-uniqueness assertion compares exact strings. Deferred to N10.2/N10.3: alert text and the dashboard naming probes by `probe` rather than URL.
bryan closed this pull request 2026-11-10 16:09:52 +00:00
bryan reopened this pull request 2026-11-10 16:10:13 +00:00
bryan manually merged commit 8dbe59c128 into main 2026-11-10 16:10:16 +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!13
No description provided.