Skip to content

chart: registrar and controller replicas set no attribute a metrics backend maps to a label on its own, so replicas can collapse into one series #1560

Closed

Description

@bpalermo

The registrar and controller Deployments set only k8s.pod.name and k8s.namespace.name in OTEL_RESOURCE_ATTRIBUTES, and no service.instance.id. A pipeline that does not promote k8s.pod.name writes every replica to one series; measured with promtool against the shipped rules, AetherRegistrarSnapshotDiverged then never fires (it fires as soon as any label keeps the replicas apart).

Fix: set service.instance.id=$(POD_NAME) on both, as the edge proxy container already does, so the default OTLP mapping to instance separates replicas without pipeline configuration. See docs/observability/metric-labels.md (#1554).

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

Activity

  1. added
    enhancement
    chart
    observability
    on Oct 9, 2026
  2. bpalermo commented on Oct 9, 2026

    @bpalermo
    OwnerAuthor

    The edge control plane has the same gap: its container sets k8s.node.name but no service.instance.id, the chart runs two replicas with soft node spreading, and both report the pin gauges, so two replicas on one node write identical (job, node, pin, reason) series. The same service.instance.id=$(POD_NAME) on the agent container of edge-deployment.yaml closes it. Include it in this issue's fix.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

  3. bpalermo commented on Oct 9, 2026

    @bpalermo
    OwnerAuthor

    Tried in #1595 and taken out of it after review. The fix proposed here (service.instance.id=$(POD_NAME) on the registrar, the controller and the edge control plane) trades one failure of the shipped rules for another, and the trade cannot be made by the chart alone.

    The mechanism. The pod name as a label (instance) makes every roll of these Deployments start a new set of series. The metrics are pushed over OTLP, so there is no staleness marker: a terminated pod's last sample stays in Prometheus's 5-minute lookback beside its replacement's. The shipped rules aggregate over replicas, so for those five minutes they read a pod that is gone.

    Evidence. promtool test rules against docs/observability/agent-pin-alerts.yml and registrar-alerts.yml as they are on main, 1-minute samples, an old pod's series ending at t=9m and its replacement's starting at t=10m:

    Rule With instance = pod name Today (one series for the replicas)
    AetherMeshClusterUnpinned (sum by (job, node, reason), for: 3m) old pod's last sample is 1, new pod reports 0: the alert fires at 12m–14m. An alert that was rightly firing is still firing at 11m and clears by 15m the new pod overwrites the series; no alert at 11m
    AetherMeshClusterPinPending (same sum, for: 5m) the same single sample does not fire it (checked at 13m, 14m, 15m) same
    AetherRegistrarSnapshotDiverged (for: 3m) an old registrar's last export is a hash that is not its revision's (the between-RPC-and-sync state for: 3m exists to ride out), the other old replica reported the right one: fires at 13m–14m for the old revision, though both live replicas agree never fires, also on a real divergence: one series is never two hashes
    the same rule, real divergence between the two live replicas from 10m a dead registrar's last aether_registrar_writebehind_queue_depth of 3 keeps the unless on (job) arm true: not firing at 14m (without that sample it is pending from 10m), firing by 19m never fires
    count(aether_registrar_snapshot_content_hash) 4 at 12m, 2 at 16m 1

    AetherProxyHoldsUnpinnedClusters was not run.

    Which is worse. For the registrar rule today's state is the worse one: the rule is dead unless the pipeline promotes something per replica. For the pin rules the label is the worse one: a critical alert from one sample after an edge roll. Anyone whose pipeline already makes a pod label from k8s.pod.name (the example in metric-labels.md) has the middle column today, with or without this issue.

    What a fix needs, in this order:

    1. The rules select fresh series only: each selector restricted to series with a sample newer than about two export intervals (m and (time() - timestamp(m) < 150)), on all three pin rules and on the three registrar metrics, with roll cases in the rule tests. The comment in registrar-alerts.yml that says no staleness handling is needed is true only while a replica keeps one series across a roll.
    2. Then the attribute, in a later chart: operators who installed the rules from an earlier release have to update them before or with that chart, and the chart cannot check that they did.

    An alternative that needs no rule change is a replica label that survives a roll (the node, where each replica has a node to itself, as on a cluster that spreads them hard); the chart only spreads softly.

    #1595 leaves the three Deployments as they are, adds a guard test that pins every workload's OTEL_RESOURCE_ATTRIBUTES with this reasoning beside it, and documents the effect in docs/observability/metric-labels.md, "A label that holds the pod name".

    🤖 Generated with Claude Code

    https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    chartenhancementobservability

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions