Skip to content

chore(registrar)!: the deprecated aether.registrar.snapshot.content gauge is removed - #1667

Merged
bpalermo merged 2 commits into
mainfrom
chore/registrar-remove-snapshot-content-gauge
Oct 11, 2026
Merged

bpalermo merged 2 commits into
mainfrom
chore/registrar-remove-snapshot-content-gauge

Conversation

@bpalermo

@bpalermo bpalermo commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

What

Removes the registrar's deprecated info gauge aether.registrar.snapshot.content{content_hash} (Prometheus aether_registrar_snapshot_content).

It was deprecated in chart 2.4.12 (#1329, #1346) in favour of aether.registrar.snapshot.content_hash, which carries the hash as its value on one label-free series per replica and is what the shipped rule AetherRegistrarSnapshotDiverged reads. Under the compatibility window (AGENTS.md, charts/README.md: deprecated in 2.4.x, removable from 2.5.0 on) it may go now. #1658 wrote "chart 2.6.0 at the earliest" beside it in four places; that dating was one minor too cautious and is corrected here.

Operator-visible. Chart 2.5.9 (was 2.5.8 on main).

What an operator sees

  • The metric disappears from every registrar once the registrar Deployment has rolled. Prometheus still returns the old pods' last samples for its five-minute lookback.
  • A rule, recording rule or dashboard that still reads it returns no data and no error: an alert on it can no longer fire and stays green.
  • Use aether_registrar_snapshot_content_hash (exported by every registrar since chart 2.4.12). The runbook's new "Chart 2.5.9" section has the full divergence expression, a grep to find what still reads the old name, and the checks for after the upgrade.
  • A rule that kept the transitional second or arm keeps working (an arm that returns nothing leaves the first arm); the arm can be deleted.
  • The shipped rule file never read the old metric: its expression and its promtool tests are unchanged.

What rolls: the registrar Deployment (its image changed). No template changed.

helm template of the chart package built at main and at this branch (stub kubeconfig, --set controller.webhook.spire=true), 2,366 lines each, 60 changed lines:

29 <     helm.sh/chart: aether-2.5.8
29 >     helm.sh/chart: aether-2.5.9
 1 <           image: "quay.io/aethermesh/registrar@sha256:ffd4b5903aed…"
 1 >           image: "quay.io/aethermesh/registrar@sha256:bc04cabf8b58…"

The helm.sh/chart label is on object metadata only (not on a pod template), so the one pod-template change is the registrar's image.

Changes

Code (registrar/internal/server/metrics.go, 30 lines out, 12 in): the instrument, the attrContentHashLabel attribute key, and observeContent (the helper that observed both gauges; the value half is now inline in the callback). The value gauge, store_revision and snapshot_revision are untouched.

Nothing else referenced the removed identifiers. Both are unexported, so the package and its tests are the whole reference set; make go-build-plain (go build ./... and go vet ./... over all 138 packages of the module, tests included, none excluded) is clean and git grep 'observeContent\|attrContentHashLabel' is empty.

Tests (metrics_test.go):

  • TestMetrics_ObserveSnapshot asserted the revision gauges and then the labelled gauge. The revision assertions stay, and it now also checks that snapshot_revision follows three more listings.

  • TestMetrics_ContentHashGauge and TestMetrics_ObserveSnapshotWithoutRevisions each lose their one assertion on the labelled gauge and keep every assertion on the value gauge.

  • New TestMetrics_RemovedContentGaugeIsNotExported (with and without a revisioned backend): the exported metric set does not contain the name, no gauge data point carries a content_hash attribute, and the value gauge is exported. Seen red against the unchanged code first:

    --- FAIL: TestMetrics_RemovedContentGaugeIsNotExported/revisioned_backend
        aether.registrar.snapshot.content carries a content_hash attribute
        aether.registrar.snapshot.content is exported; it was removed in chart 2.5.9 (use aether.registrar.snapshot.content_hash)
    

Docs:

  • docs/runbook.md: new "Chart 2.5.9" section; the row of the "Chart 2.5.7" deprecation table is closed ("any chart from 2.5.0 on; removed in chart 2.5.9"); in "Stored vs in place vs applied", the "Deprecated" passage with the two-arm expression and the order of work (62 lines) is replaced by one paragraph in the past tense.
  • docs/observability/README.md: "Deprecated" becomes "Removed", in the past tense; the sentence about tests of the transitional arm kept elsewhere is gone.
  • docs/observability/registrar-alerts.yml: the UPGRADING comment (10 lines) is replaced by five lines saying the labelled gauge is no longer exported. The file carried the arm only as a comment, never in expr.
  • docs/observability/metric-labels.md did not list the old metric: no change.
  • test/harnesscontract/external-harness.yaml and its lock do not name any registrar snapshot metric: the contract is unchanged.

What is left

git grep -n 'snapshot_content\|snapshot\.content', without the replacement …content_hash, now returns only:

  • docs/runbook.md: the "Chart 2.5.9" section (title, the removal text, the grep pattern, the "must be empty" query), the closed row of the "Chart 2.5.7" table, and the past-tense paragraph in "Stored vs in place vs applied";
  • docs/observability/README.md ("Removed: …") and docs/observability/registrar-alerts.yml (the comment above), both in the past tense;
  • registrar/internal/server/metrics.go: nothing by name (a past-tense comment says why the hash is not a label);
  • registrar/internal/server/metrics_test.go: the constant the absence test checks for.

None presents the metric as current.

Verification

  • bazel test //registrar/... //:observability_rules_test //charts/... //website:site_test //test/harnesscontract:checks: 283 pass
  • bazel test --config=race on the six go_test targets under //registrar/...: pass
  • make go-build-plain: go build ./... and go vet ./... ok, none excluded
  • bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //...: ok
  • make format-check: ok

Not run on a cluster.

Written by an AI coding agent.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

bpalermo and others added 2 commits October 11, 2026 02:02
…auge is removed

The labelled info gauge aether.registrar.snapshot.content{content_hash}
(Prometheus aether_registrar_snapshot_content) was deprecated in chart 2.4.12
(#1329, #1346) in favour of aether.registrar.snapshot.content_hash, which
carries the hash as its value and is what the shipped rule
AetherRegistrarSnapshotDiverged reads. Deprecated in 2.4.x means removable from
2.5.0 on; the "chart 2.6.0 at the earliest" written beside it by #1658 was one
minor too cautious and is corrected here.

- registrar: the instrument, its content_hash attribute key and the helper
  that observed both gauges are gone; the value gauge and the revision gauges
  are untouched. A test asserts the exported metric set does not contain the
  name, and that no gauge data point carries a content_hash attribute.
- docs: the runbook's transitional `or` arm and its order of work, the
  "Deprecated" sections of the runbook and docs/observability/README.md, and
  the upgrade comment in registrar-alerts.yml are replaced by a short account
  in the past tense. The shipped rule and its promtool tests never read the
  metric and are unchanged.
- chart 2.5.9: a runbook section says what an operator sees (a rule or a
  dashboard still reading the metric returns no data, silently), the query to
  use instead, and closes the row of the "Chart 2.5.7" deprecation table.

The upgrade rolls the registrar Deployment (new image); no template changed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
@bpalermo
bpalermo merged commit ad6e66e into main Oct 11, 2026
30 checks passed
@bpalermo
bpalermo deleted the chore/registrar-remove-snapshot-content-gauge branch October 11, 2026 05:29
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