Repository navigation
fix(chart, observability): registrar, controller and edge control-plane replicas are separate series by default, and the shipped rules read only fresh samples (#1560) - #1642
Merged
Conversation
…ne replicas are separate series by default, and the shipped rules read only a series whose last sample is fresh (#1560) The registrar, the controller and the edge control plane set no resource attribute a metrics backend maps to a per-replica label by itself, so their replicas wrote one series and AetherRegistrarSnapshotDiverged could never fire. Chart 2.5.3 sets service.instance.id=$(POD_NAME) on the three (the edge proxy container already had it). Prometheus stores it as `instance`. A pod name in a label makes every roll end one set of series and start another, and a pushed series has no staleness marker: a bare selector returns a replaced pod's last sample for five minutes. Every selector of agent-pin-alerts.yml and registrar-alerts.yml is therefore wrapped in last_over_time(...[150s]): 2.5 of the components' 60 s export intervals, so a live pod that loses one export is still read, and below the shortest `for:` (3m), so one last sample of a pod that is gone is never an alert. registrar-alerts_test.yml is new; the pin and xDS rule tests gain the roll cases. Red first against the unchanged rules; the window is mutation-checked in both directions. Closes #1560 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
bpalermo
added a commit
that referenced
this pull request
Oct 10, 2026
…eady holds 2.5.3 (#1642) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
bpalermo
added a commit
that referenced
this pull request
Oct 10, 2026
…cdf11d438dd7ff5b83 (#1644) * chore(proxy): pin aether chart to aether-proxy:7ae32088c8fb9bdb176e55cdf11d438dd7ff5b83 Pushed by the proxy-release run for 7ae3208. Moves both tag: and digest: (aether.image prefers digest over tag) and bumps the chart patch version. * chore(chart): the proxy image pin takes chart version 2.5.4; main already holds 2.5.3 (#1642) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> 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.
Closes #1560
What was wrong
The registrar, the controller and the edge control plane set no resource attribute that a metrics backend maps to a per-replica label by itself. A pipeline that promoted nothing per replica stored all replicas of a component as one series, and
AetherRegistrarSnapshotDiverged, which compares hashes across replica series, could never fire.The obvious fix (
service.instance.id=$(POD_NAME)) was tried in #1595 and taken out: the metrics are pushed over OTLP, there is no staleness marker, so after a roll a replaced pod's last sample stays in Prometheus's 5-minute lookback beside its replacement's, and the shipped rules, which aggregate over replicas, read a pod that is gone.This pull request ships both halves together.
1. Chart 2.5.3 (
charts/aether)service.instance.id=$(POD_NAME)inOTEL_RESOURCE_ATTRIBUTESon the registrar, the controller and theagentcontainer of the edge Deployment. The edge proxy container already had it.Rendered with
--set controller.webhook.spire=true,edge.enabled=true,otel.enabled=true,otel.endpoint=…, before (2.5.2) and after (2.5.3):k8s.pod.name=$(POD_NAME),k8s.namespace.name=$(POD_NAMESPACE)service.instance.id=$(POD_NAME),k8s.pod.name=$(POD_NAME),k8s.namespace.name=$(POD_NAMESPACE)agentk8s.node.name=$(NODE_NAME),k8s.namespace.name=…,k8s.pod.name=…,k8s.pod.uid=…,k8s.deployment.name=…service.instance.id=$(POD_NAME),followed by the sameservice.instance.id=$(POD_NAME))Nothing else in the render differs except the
helm.sh/chartlabel on object metadata. Pod templates compared per workload: the three Deployments change; the agent, mesh-dns, proxy and uds-csi DaemonSets do not.What rolls on upgrade: the registrar, the controller and (when enabled) the edge Deployment, once each. The variable is rendered whether or not
otel.endpointis set, so this is on every install, and there is no value to turn it off. No DaemonSet rolls and no Envoy restarts on the nodes.Not set on the per-node DaemonSets on purpose: their series are told apart by the node, which is stable across a roll.
Tests (
charts/aether/BUILD.bazel), red against the unchanged templates first:aether_resource_attributes_test(was…_unchanged_test): every workload's wholeOTEL_RESOURCE_ATTRIBUTES, so the DaemonSets are pinned as they were.aether_replica_instance_id_default_values_test: the same for the registrar and the controller with default values.2. Shipped rules (
docs/observability)Every selector in
agent-pin-alerts.yml(four rules) andregistrar-alerts.yml(three metrics) is wrapped:the newest sample of each series, if it is at most 150 s old, in place of the 5-minute lookback of a bare selector.
Why 150 s. These components export every 60 s: the OTel SDK's periodic reader at its default interval (
common/telemetry/setup/setup.gopasses no interval, and the chart sets noOTEL_METRIC_EXPORT_INTERVAL).for:.for:of those rules, so one last sample of a pod that is gone is never an alert by itself.Rules changed
AetherMeshClusterUnpinned,AetherMeshClusterPinPending,AetherProxyHoldsUnpinnedClusters,AetherProxyPinStateUnknownagent-pin-alerts.ymlAetherRegistrarSnapshotDiverged(hash, revision and theunlesson queue depth)registrar-alerts.ymlRules left as they are, and why
AetherProxyRejectedListenerUpdate(agent-xds-alerts.yml): it reports an event of the last hour from a counter.increase()over a series that ended still counts what it counted, and the second arm is already limited to a series' first hour; a window would only end a true alert sooner. The window would not help the pinned surge-roll limit either: there the two node agents write ONE series, and no selector can tell their samples apart. That needs a per-pod label on the node agent, which this change does not add. New test cases say what a series per edge pod changes for this rule.mesh-dns-alerts.yml,agent-cni-alerts.yml: they read the per-node DaemonSets (and the prober's counter byrate()), whose series gain no label here and keep their identity across a roll.Proof
bazel test //:observability_rules_test. The roll case is the issue's: an old pod's series end at minute 9, its replacement's start at minute 10, one sample a minute.AetherMeshClusterUnpinned: old edge pod's last export reported 1, replacement reports 0AetherMeshClusterPinPendingfiring on the old podAetherRegistrarSnapshotDiverged: a replaced registrar's last hash is not its revision'sregistrar-alerts_test.ymlis new (the rule had no test in this repository). The existing cases of the other two files pass unchanged.Mutation check of the window (both rule files, then restored):
[90s]and[120s]fail the missed-export cases;[5m]fails the roll cases; no window is the red-first run above.[180s]passes: on a one-minute grid a sample exactly 180 s old is outside a left-open range, so the tests bound the window to more than 120 s and at most 180 s, not to 150 s exactly.Limits, pinned in the tests or stated in the files
AetherMeshClusterUnpinned(for: 3m) fires for one evaluation after the pod is gone (limit - a replaced pod's last two samples fire for one evaluation). With bare selectors it fired for three.agent-xds-alerts_test.yml, alimitcase).What an operator sees on upgrade
AetherMeshClusterUnpinnedandAetherRegistrarSnapshotDivergedfalsely after a roll of the edge or the registrar. The chart cannot check which rules are installed.instance="<pod name>". The series without it receive no more samples. A panel that does not aggregate shows one line per pod, and at every later roll old lines end and new ones start.service.instance.id/instancefrom these series.docs/runbook.md, "Chart 2.5.3", has the order of work and the queries to run after the roll.docs/observability/metric-labels.mdandREADME.mdare updated (what each component sets, what must not be dropped, the window and its reasons, installing the rules with the chart).Measured and not
Measured: the rule behaviour above, with the pinned
promtool; the render and the per-workload pod-template comparison, withhelm template.Not run on a cluster. Not measured: counters across the label change (a
sum(rate())can read low around the roll), and delivery delay between a component's export and the store, which the 30 s of margin in the window is for.Checks run
bazel test //charts/... //:observability_rules_test //test/harnesscontract:checks,bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //...,make format-check. The external-harness contract is unchanged (no workload, container or label name of the chart moved).🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr