Skip to content

fix(telemetry): per-node identity for static infra cluster stats (agent_xds) - #210

Merged
bpalermo merged 1 commit into
mainfrom
fix/agent-xds-stats-node-identity
Jun 17, 2026
Merged

bpalermo merged 1 commit into
mainfrom
fix/agent-xds-stats-node-identity

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

Problem

The Grafana panels
rate(envoy_cluster_upstream_rq_tx_reset_total{aether_cluster="agent_xds"}) and
rate(envoy_cluster_upstream_cx_connect_fail_total{aether_cluster="agent_xds"})
show a flat, constant ~2.8/s fleet rate — alarming, but not a real failure.

agent_xds is the static bootstrap cluster every Envoy uses to reach its
co-located agent xDS over the UDS pipe. Investigation on talos-main:

  • The ADS stream is healthy (cx_active=1, rq_active=1, clean proxy logs, config flowing). The data plane (mesh clusters) has zero connect failures.
  • The agent_xds metric is a single fleet-wide series carrying only the aether_cluster label — no pod/node identity.

The OTLP stat sink builds its Resource solely from configured resource_detectors (open_telemetry_impl.cc), and there were none, so the Resource is empty. All 5 proxies therefore push their cumulative counters onto the same identityless series. rate()/increase() over that colliding series interpret the interleaved per-proxy values as a continuous stream of increments + resets → a phantom constant rate. The collapse is correct for per-service mesh clusters (bounds cardinality at the node target) but wrong for the static infra clusters, of which exactly one exists per node.

Fix

  • Add the environment resource detector to the OTLP stat sink (already compiled into the custom proxy — config-only, no rebuild).
  • Stamp OTel k8s.* semantic-convention attributes (k8s.node.name, k8s.namespace.name, k8s.pod.name, k8s.pod.uid) into the Resource via OTEL_RESOURCE_ATTRIBUTES from the downward API.
  • Bump agent chart 0.2.2 → 0.2.3.

Companion change (already applied in-cluster)

The otel-collector already promoted host.name → node globally. That has been changed (helm otel-collector, o11y, rev 14) to source from k8s.node.name and promote only for agent_xds/otel_collector:

set(attributes["node"], resource.attributes["k8s.node.name"])
  where resource.attributes["k8s.node.name"] != nil
    and (attributes["aether.cluster"] == "agent_xds" or attributes["aether.cluster"] == "otel_collector")

This keeps mesh stats collapsed (no per-node cardinality split at the 10k-node target) while giving the infra clusters per-node identity. k8s.node.name (not k8s.pod.name) is promoted so the per-node counter series survives proxy hot-restarts cleanly. The collector change was applied first, so there is no window where mesh stats split when this chart deploys.

Validation

  • Chart renders; extracted envoy.yaml parses with the detector in place.
  • Detector field/type/category verified against the custom Envoy's own protos; extension confirmed in the curated build set.
  • Collector upgrade rolled out clean; OTTL statement parsed and accepted.

🤖 Generated with Claude Code

The OTLP stat sink emits an empty OTLP Resource (it builds the resource
solely from configured resource_detectors, of which there were none), so
every proxy's stats collapse onto one identityless series per aether.cluster.
That collapse is intended for per-service mesh clusters (bounds cardinality
at the node-count target), but it breaks the static infra clusters
(agent_xds, otel_collector): exactly one such cluster exists per node, so N
proxies multiplex N cumulative counters onto a single series. rate()/
increase() over that colliding series fabricate phantom upstream_rq_tx_reset
and upstream_cx_connect_fail — a flat, constant ~2.8/s fleet rate with no
real failure behind it (ADS stream is healthy; absolute counters are tiny).

Add the environment resource detector to the stats sink and stamp OTel
k8s.* semantic-convention attributes (k8s.node.name/namespace/pod/uid) into
the Resource via OTEL_RESOURCE_ATTRIBUTES from the downward API. The
collector promotes k8s.node.name -> a `node` label ONLY for the two static
infra clusters (selective transform/promote), so their per-node series stop
colliding while mesh clusters stay collapsed. k8s.node.name (not pod.name)
is promoted so the counter series survives proxy hot-restarts cleanly.

Config-only: the environment resource detector is already compiled into the
custom proxy; no rebuild. Bumps the agent chart 0.2.2 -> 0.2.3.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
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