Integrate Durable Pi intake health with Prometheus, Alertmanager and Grafana #8

Open
opened 2026-10-16 21:45:16 +00:00 by bryan · 1 comment
Owner

Problem / Motivation

A running background service or reachable web page does not prove its upstream intake is making progress. Use the existing monitoring stack to expose stale intake, partial coverage and recovery, rather than introduce another monitoring service or a competing application alert loop.

Proposed behavior

Once Durable Pi exposes an application-owned metrics contract, add a declarative scrape configuration, sustained-condition alert rules and Grafana panels. Preserve the existing responsibility split: Prometheus collects/evaluates, Alertmanager groups and routes, Grafana visualizes.

Distinguish an unavailable scrape target, stale successful intake and partial repository failure. Handle startup/never-observed state and intentionally disabled intake explicitly. No new PRs is healthy idle operation; review capacity deferrals are not intake failure. Choose sustained thresholds from documented poll cadence and expected outages, not a transient nonzero error counter.

Scope

In scope

  • Existing monitoring module and declared dashboard provisioning; bounded repository labels, intake freshness/failure/recovery panels and actionable alert annotations.
  • Integrate with the existing notification route, deduplication and resolved-notification behavior. Decide and document routing without assuming a Matrix receiver already exists; do not create one or duplicate application notifications implicitly.
  • Document the required application metrics/endpoint contract as an explicit dependency before implementation. Keep scraping on an appropriate private/local path; no new public exposure or private project contents in metrics.

Out of scope

  • Implementing the application's observations/exporter, a new monitoring platform, external host-outage monitoring, autonomous remediation or unrelated dashboard redesign.

Implementation hints

Use modules/services/monitoring.nix and the existing Grafana dashboard provisioning. Coordinate with the application's exporter delivery; metric names and scrape coordinates are to be verified, not guessed. Follow the normal declarative deployment process.

Acceptance criteria

  • The application metric contract is verified and the generated scrape/rule configuration passes native validation and repository checks.
  • Rules and tests distinguish unavailable, stale, partial, never-observed, intentionally disabled and recovered states. Healthy idle operation and capacity deferrals do not fire intake-failure alerts.
  • Grafana shows freshness, scope of failures and recovery; alert annotations state the condition, affected scope and useful investigation step.
  • Notification grouping, routing and resolution are verified without duplicate application/monitoring notices. The declared target, rule state and dashboard are read back after an explicitly authorized deployment.
## Problem / Motivation A running background service or reachable web page does not prove its upstream intake is making progress. Use the existing monitoring stack to expose stale intake, partial coverage and recovery, rather than introduce another monitoring service or a competing application alert loop. ## Proposed behavior Once Durable Pi exposes an application-owned metrics contract, add a declarative scrape configuration, sustained-condition alert rules and Grafana panels. Preserve the existing responsibility split: Prometheus collects/evaluates, Alertmanager groups and routes, Grafana visualizes. Distinguish an unavailable scrape target, stale successful intake and partial repository failure. Handle startup/never-observed state and intentionally disabled intake explicitly. No new PRs is healthy idle operation; review capacity deferrals are not intake failure. Choose sustained thresholds from documented poll cadence and expected outages, not a transient nonzero error counter. ## Scope ### In scope - Existing monitoring module and declared dashboard provisioning; bounded repository labels, intake freshness/failure/recovery panels and actionable alert annotations. - Integrate with the existing notification route, deduplication and resolved-notification behavior. Decide and document routing without assuming a Matrix receiver already exists; do not create one or duplicate application notifications implicitly. - Document the required application metrics/endpoint contract as an explicit dependency before implementation. Keep scraping on an appropriate private/local path; no new public exposure or private project contents in metrics. ### Out of scope - Implementing the application's observations/exporter, a new monitoring platform, external host-outage monitoring, autonomous remediation or unrelated dashboard redesign. ## Implementation hints Use `modules/services/monitoring.nix` and the existing Grafana dashboard provisioning. Coordinate with the application's exporter delivery; metric names and scrape coordinates are to be verified, not guessed. Follow the normal declarative deployment process. ## Acceptance criteria - [ ] The application metric contract is verified and the generated scrape/rule configuration passes native validation and repository checks. - [ ] Rules and tests distinguish unavailable, stale, partial, never-observed, intentionally disabled and recovered states. Healthy idle operation and capacity deferrals do not fire intake-failure alerts. - [ ] Grafana shows freshness, scope of failures and recovery; alert annotations state the condition, affected scope and useful investigation step. - [ ] Notification grouping, routing and resolution are verified without duplicate application/monitoring notices. The declared target, rule state and dashboard are read back after an explicitly authorized deployment.
Author
Owner

A second Pi Durable service now serves /metrics: the Claude usage sampler (durable-pi-workspace#236). It's live on Studio since 2026-11-01, at http://127.0.0.1:8791/metrics, and on the tailnet at https://bryans-mac-studio.tail5ba690.ts.net:8791/metrics.

Its metrics contract (seven series, with their names, types and meanings) is in the sampler's runbook, section 4: https://git.snowboardtechie.com/bryan/durable-pi-workspace/src/branch/main/workspaces/sampler/OPERATIONS.md#4-the-page-and-metrics

Scraping and alerts for it belong to this issue, with SGG's.

A second Pi Durable service now serves `/metrics`: the Claude usage sampler (durable-pi-workspace#236). It's live on Studio since 2026-11-01, at `http://127.0.0.1:8791/metrics`, and on the tailnet at `https://bryans-mac-studio.tail5ba690.ts.net:8791/metrics`. Its metrics contract (seven series, with their names, types and meanings) is in the sampler's runbook, section 4: https://git.snowboardtechie.com/bryan/durable-pi-workspace/src/branch/main/workspaces/sampler/OPERATIONS.md#4-the-page-and-metrics Scraping and alerts for it belong to this issue, with SGG's.
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#8
No description provided.