Repository navigation
docs(observability): a staleness-safe registrar divergence rule; say which ext_authz counters exist - #1328
Merged
Conversation
…which ext_authz counters exist #1322: the runbook's "same revision, two content hashes" expression counted hashes over the bare aether_registrar_snapshot_content selector. content_hash is a label, so a content change ends one series and starts another, and with no OTLP staleness marker Prometheus returns the superseded series for its 5-minute lookback. Every content change read as a divergence for 5 minutes. Its queue-depth clause was also empty (so the expression could never be true) on a registrar that had never queued a write-behind intent. The new expression keeps, per replica, the content series with the newest timestamp(), labels it with the replica's revision and counts hashes per revision. It ships as AetherRegistrarSnapshotDiverged in docs/observability/registrar-alerts.yml. This repo has no promtool in its build, so the unit tests are in the GitOps repo's rules_test.yaml. #1325: document in the runbook that a missing ext_authz series means "never happened" (the OTLP sink exports a counter only once used), that failure_mode_allowed needs fail-open, and that Envoy's HTTP ext_authz filter has no timeout counter at all. Closes #1322 Refs #1325 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Prometheus absence semantics are misstated and existing canary documentation contradicts the new counter guidance.
Review effort: Balanced
Findings: 1
What changed in this PR
Adds staleness-safe registrar divergence alerting guidance and documents available Envoy ext_authz counters.
Changes:
- Adds
AetherRegistrarSnapshotDiverged. - Documents Prometheus lookback handling and rule behavior.
- Clarifies
ext_authzcounter availability.
| File | Description |
|---|---|
registrar/internal/server/metrics.go |
Documents stale hash-series behavior. |
docs/runbook.md |
Adds divergence queries and counter guidance. |
docs/observability/registrar-alerts.yml |
Defines the divergence alert. |
docs/observability/README.md |
Documents alert purpose and installation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+2686
to
+2690
| - There is **no `timeout` counter**. Envoy's HTTP `ext_authz` filter does not define one | ||
| (checked at the pinned Envoy, `ALL_EXT_AUTHZ_FILTER_STATS` in | ||
| `source/extensions/filters/http/ext_authz/ext_authz.h`). A check that exceeds | ||
| `proxy.authzSidecar.timeout` is counted in `error`. Do not gate on | ||
| `…_ext_authz_timeout_total`: it reads as a clean zero forever. |
bpalermo
added a commit
that referenced
this pull request
Oct 7, 2026
…1329) (#1346) aether.registrar.snapshot.content carries the hash as a label. A content change ends one series and starts another, OTLP has no staleness marker for a series an observable gauge stopped reporting, and Prometheus keeps returning the superseded hash for its 5-minute lookback. #1328 worked around that in the divergence rule with a timestamp() filter. Add aether.registrar.snapshot.content_hash, whose VALUE is the hash: the first 13 hex digits (52 bits) of the content hash, an integer a float64 holds exactly. One series per replica, no label that changes. The conversion lives in common/snapshotversion (ContentHashValue) next to the version parser. The gauge is observed in the same callback, from the same Snapshot.State(), as the revision gauges, on every backend and in every version form. The labelled metric is deprecated and kept for one release so a rule on it keeps working while replicas of both images run. docs: AetherRegistrarSnapshotDiverged is now a plain count of distinct values per (job, revision); the runbook has the by-hand query, the bit budget, how the two metrics arrive, and the two-arm rule for the upgrade. Closes #1329 Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Docs and one rule file. No behaviour change in any binary (the only Go edit is a comment in
registrar/internal/server/metrics.go).#1322: the divergence expression
The runbook's expression counted hashes over the bare
aether_registrar_snapshot_contentselector.content_hashis a label, so a content change ends one series and starts another. The registrar stops exporting the old one, but OTLP has no staleness marker, so Prometheus returns it for the 5-minute lookback and every replica shows two hashes after every change.It had a second fault:
aether_registrar_writebehind_queue_depthis recorded only when an intent is queued or flushed. Until the first one the series is missing (it is missing on talos-main now),and on() (max(...) == 0)is empty, and the expression cannot be true at all.New expression, in the runbook and as
AetherRegistrarSnapshotDivergedin the newdocs/observability/registrar-alerts.yml:timestamp()filter keeps, per replica, the content series with the newest sample. A superseded hash is in the lookback but older.count_valueslabel that series with the replica's revision, so hashes are counted per revision and a lagging replica is not compared.unless ... > 0is quiet only when a pending intent is actually reported.On live Prometheus over the soak window (8 h to 2026-10-06T23:02:13Z, 15 s steps, 1,920 samples) the old expression's first two clauses return a sample at 386 steps and the new one at 0.
Where the test is
This repo has no promtool in its build, and
docs/observability/*.ymlare validated where they are deployed. The unit tests are in bpalermo/k8s-talos-main#152 (clusters/talos-main/prometheus/rules_test.yaml, promtool 3.6.0):for: 3mNot done: one series per replica at the source
The registrar already exports one series per replica; the second one is Prometheus's lookback, and the OTel Go SDK has no way to send a staleness marker for an attribute set an observable gauge stopped reporting. The source fix that would work is a gauge whose value is the hash (the top 52 bits fit a float64 exactly), which has no label to go stale. That is a new metric and a rule migration, so it is left as a follow-up.
#1325: which
ext_authzcounters existNew runbook paragraph under "The ext_authz sidecar across a proxy roll":
…_ext_authz_timeout_totaldoes not exist because Envoy's HTTPext_authzfilter has notimeoutcounter (ALL_EXT_AUTHZ_FILTER_STATSat the pinned726d7ac). A timed-out check is counted inerror.…_ext_authz_failure_mode_allowed_totalis a real counter that is incremented only when the filter runs fail-open. With the defaultfailureMode: DENYit never is, and Envoy's OTLP sink exports a counter only once it was used.stats_matcher(an exclusion list with noext_authzpattern) nor the collector drops these names.The alert change (remove the
timeoutarm) and the kube-state-metrics additions are in bpalermo/k8s-talos-main#152, so this PR only references #1325.Proof
bazel test //registrar/internal/server:all: 1/1 passbazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //...: cleanmake format-check: cleanpromtool check rules docs/observability/registrar-alerts.yml: 1 ruleCloses #1322
Refs #1325
🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr