Skip to content

feat(observability): ship the dashboard, the alerts, and the SLOs - #30

Merged
blakebauman merged 2 commits into
mainfrom
feat/observability-pack
Aug 11, 2026
Merged

blakebauman merged 2 commits into
mainfrom
feat/observability-pack

Conversation

@blakebauman

Copy link
Copy Markdown
Member

Roadmap Horizon 1 item 5. An operator got a /metrics endpoint, a template to scrape it with, and interpretation nowhere. Metric names are frozen by the v1 contract — which is exactly what makes publishing queries against them safe — so they are published.

What ships

What Where Enable
Grafana dashboard, 16 panels / 5 rows deploy/helm/fold/dashboards/fold-overview.json metrics.dashboard.enabled (ConfigMap for the Grafana sidecar) or import the JSON
8 alert rules, 3 groups templates/prometheusrule.yaml metrics.prometheusRule.enabled
SLO definitions and what each alert assumes docs/operations.md#dashboards-alerts-and-slos —

Rows: service level, latency, upstreams, governance (per-tenant consumption and refusals), ingress/config. Both templates render in every ci/ value set, so a broken one fails helm-check rather than a cluster.

The availability SLO counts only what fold failed

error and upstream_down. denied, rate_limited, and budget_exhausted are excluded. An SLO that counts correct refusals pages someone for tightening a policy, burns error budget when a customer hits the ceiling they were sold, and teaches the team to ignore the alert. upstream_down is counted — fold owns the federation's reachability even when the fault is an upstream's.

Same reasoning makes the latency threshold a values knob, not a constant: fold_request_duration_seconds includes the upstream's own time, so no universal number is honest. What fold promises about its own cost stays in the CI latency gate where it can be measured exactly; the dashboard carries a live approximation whose panel description says plainly why quantile subtraction over-reads on list-heavy traffic.

Nothing pages by default — severities are warning and info. The genuinely paging condition, "no upstream reachable", is a 503 from /health that an existing probe already watches.

Lockstep test

gateway/observability_pack_test.go checks the pack against the code both directions: every fold_* name a panel or rule references must be declared, and every metric declared must appear somewhere in the pack (so a new metric forces the question instead of shipping unshown).

This guards the two failure modes an operator cannot see — a panel that draws nothing and an alert that can never fire both look exactly like "healthy". Verified by mutation:

$ # rename one referenced metric by a single character
--- FAIL: TestPackReferencesOnlyDeclaredMetrics
    ../deploy/helm/fold/dashboards/fold-overview.json references
    "fold_discovery_sync_total", which this package does not declare (see metrics.go)

make check green, make helm-check green. Chart to 0.1.4.

🤖 Generated with Claude Code

blakebauman and others added 2 commits August 10, 2026 17:32
Roadmap Horizon 1 item 5. An operator got a /metrics endpoint, a template to
scrape it with, and interpretation nowhere. Metric names are frozen by the v1
contract, which is exactly what makes publishing queries against them safe, so
they are published.

A Grafana dashboard of 16 panels across five rows — service level, latency,
upstreams, governance, ingress — plus eight alert rules in three groups, both
in the chart beside the existing servicemonitor, both opt-in, and both
rendered by every ci/ value set so a broken template fails helm-check rather
than a cluster.

The availability SLO counts only the outcomes fold failed: error and
upstream_down. Denied, rate_limited, and budget_exhausted are excluded on
purpose. An SLO that counts correct refusals pages someone for tightening a
policy, burns error budget when a customer hits the ceiling they were sold,
and teaches a team to ignore the alert — while upstream_down is counted,
because fold owns the federation's reachability even when the fault is an
upstream's. For the same reason the latency threshold is a values knob rather
than a constant: fold_request_duration_seconds includes the upstream's own
time, so no universal number is honest. What fold promises about its own cost
stays where it can be measured exactly, in the CI latency gate; the dashboard
carries a live approximation and says in the panel description why quantile
subtraction over-reads on list-heavy traffic.

Nothing pages by default. Severities are warning and info, because the
genuinely paging condition — no upstream reachable — is a 503 from /health
that an existing probe already watches.

A test keeps the pack and the code in lockstep both directions: every fold_*
name a panel or rule references must be declared, and every metric declared
must appear somewhere in the pack, so a new metric forces the question rather
than shipping unshown. This guards the two failure modes an operator cannot
see — a panel that draws nothing and an alert that can never fire both look
exactly like healthy. Verified by mutation: renaming one referenced metric by
a single character fails with the file and the name.

Chart to 0.1.4.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@blakebauman
blakebauman merged commit 9a79022 into main Aug 11, 2026
6 checks passed
@blakebauman
blakebauman deleted the feat/observability-pack branch August 11, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant