Skip to content

fix(telemetry): the registrar, controller and edge control plane no longer report their pod name as host.name, and the otel.endpoint row no longer names the CNI plugin (#1596, #1614) - #1618

Merged
bpalermo merged 1 commit into
mainfrom
fix/1596-host-name-non-hostnetwork
Oct 9, 2026

Conversation

@bpalermo

@bpalermo bpalermo commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Closes #1596
Closes #1614

Operator-visible change: the telemetry resource of the registrar, the controller and the edge control plane (agent edge) no longer carries host.name, on all three signals (metrics, logs, traces). It held their pod name. A pipeline that selected or grouped those components by a label made from host.name uses k8s.pod.name instead, which the chart already sets on all three and which holds the same value. The node agent, mesh-dns and the proxy supervisor are unchanged: they are hostNetwork and their host.name is the node's.

#1596: the premise, per component

The issue was inferred from the code. A test per component came first, each reading the resource built from that component's own configuration, and was run against the unchanged behaviour:

Component Chart hostNetwork host.name before after
node agent agent-daemonset.yaml yes the host's name the same (kept)
edge control plane edge-deployment.yaml no the hostname, which in that pod is the pod name not set
registrar registrar-deployment.yaml no the same not set
controller controller-deployment.yaml no the same not set
registrar/internal/cmd   TestTelemetryResourceHasNoHostName: host.name = "<the test host's name>": on the pod network that is the pod name, not a host
controller/internal/cmd  TestTelemetryResourceHasNoHostName: host.name = "<the test host's name>": ...
agent/internal/cmd       TestTelemetryResourceHostName/the_edge_control_plane_is_on_the_pod_network_and_has_none: host.name = "<the test host's name>": ...

The node agent's case (the_node_agent_is_hostNetwork_and_keeps_host.name) was green before and is green after. mesh-dns and the proxy supervisor do not use common/telemetry/setup; their existing TestResourceHostName (#1592) still pins that they keep it.

What was measured: the resource each component builds, in a unit test. What was not: no collector output was checked, and no pod was run. "In that pod the hostname is the pod name" is Kubernetes' behaviour for a pod that is not hostNetwork, not something this PR observed.

The change

common/telemetry/setup is shared by hostNetwork and pod-network components, so it cannot choose, and its default does not change. The caller says so:

Two things moved to make each component testable in its own package, with no behaviour change:

  • manager.Config.Telemetry(name, version) is the one mapping from a component's manager configuration to its setup.Config. Bootstrap and SetupManagerLogging each had a literal; the logger's was a shorter copy, which is where a new field would have been forgotten.
  • setup.newResource is exported as setup.NewResource.

What replaces host.name for these three

Nothing needs to. k8s.pod.name is already on all three resources (from the chart's OTEL_RESOURCE_ATTRIBUTES) and holds the value host.name held. Open PR #1595 also adds service.instance.id=$(POD_NAME) to exactly these three, which Prometheus stores as instance. So the pod name is on the resource once now and twice after #1595; host.name was a third copy under a name that says "host".

docs/observability/metric-labels.md gets a per-component host.name table in place of the sentence that said every Go component but the prober sets it. It does not mention service.instance.id for these components: that is #1595's to say. Both PRs edit that file; the second to merge will have a textual conflict in the list above "Labels that are not your pipeline's job" (this PR rewrites the last bullet, #1595 the ones before it).

#1614

docs/configuration.md, otel.endpoint: the row said the value is baked into the CNI plugin and that an empty value disables "the proxy/CNI stat sink". The CNI plugin takes no endpoint and exports nothing since #1166/#1185. The row now says who receives the value (each Go component as --otlp-endpoint, and the two Envoy bootstraps) and points at the cniInstall section, which already had it right.

The same sentence was in docs/getting-started.md ("Observability"); corrected there too. charts/aether/values.yaml has it a third time in a comment, which this PR leaves alone: it changes nothing under charts/.

Tests

  • TestTelemetryResourceHasNoHostName in registrar/internal/cmd and controller/internal/cmd: the package's own cfg, the one the command builds its providers from.
  • TestTelemetryResourceHostName in agent/internal/cmd: runs the shared PersistentPreRunE for the root command and for edge, then reads the resource.
  • TestResourceHostName in common/telemetry/setup, now two cases: the default keeps it, WithoutHostName drops it and nothing else.
  • TestConfigTelemetry in common/manager: every field of the mapping.

Mutations, each reverted:

Mutation Red
NewRegistrarConfig does not set it the registrar's test
NewControllerConfig does not set it the controller's test
applyEdgeTelemetry does nothing the edge case
PersistentPreRunE does not call it the edge case
applyEdgeTelemetry applies to every command the node agent case
Config.Telemetry drops the field TestConfigTelemetry, and all three components
setup.NewResource ignores the field TestResourceHostName, and all three components
setup.NewResource drops host.name by default TestResourceHostName, and the node agent case

Not covered by a test: that SetupManagerLogging builds its provider from Config.Telemetry and not from a literal of its own. The provider's resource is not readable from outside it.

Guards

  • //agent/cmd/... (every deps_test, and the agent, mesh-dns, proxy-supervisor and uds-csi image_test), //controller/cmd/controller:image_test, //registrar/cmd/registrar:image_test: green. No library gains an import (common/manager already imported common/telemetry/setup).
  • bazel test //test/harnesscontract/...: green. Nothing there is edited, and no name in the contract changes.
  • --config=race --build_tests_only on the five touched go_test targets: green.
  • Lint scoped to the touched packages, make format-check, make go-build-plain (136 packages, none excluded): green.

No chart, no workflow, no proto change.

An agent wrote this pull request.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

…onger report their pod name as host.name, and the otel.endpoint row no longer names the CNI plugin (#1596, #1614)

common/telemetry/setup kept the OTel host detector for every component
built on it. The node agent is hostNetwork, so its host.name is the
node's. The registrar, the controller and the edge control plane are on
the pod network, so theirs was the pod name: the resource #1041 fixed
for the prober, where a collector promoted host.name to the node label
ahead of k8s.node.name.

The package is shared by both kinds, so it cannot choose. setup.Config
and manager.Config gain WithoutHostName (zero value: host.name kept, as
before), and the three components that are not hostNetwork set it:
NewRegistrarConfig, NewControllerConfig, and the edge in the
PersistentPreRunE it shares with the node agent (applyEdgeTelemetry,
agent/internal/cmd/edge.go), before the logger's provider is built.

manager.Config.Telemetry is now the one mapping from a component's
manager configuration to its telemetry setup; the logger's provider used
a second, shorter literal. setup.NewResource is exported so each
component pins its own resource in its own package.

Docs: metric-labels.md says which component sets host.name;
configuration.md and getting-started.md no longer say the collector
endpoint is baked into the CNI plugin, which exports no telemetry of its
own since #1166/#1185.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
Copilot AI balanced review requested due to automatic review settings October 9, 2026 22:53
@bpalermo bpalermo added the observability Metrics, logs, profiles, alerts label Oct 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The corrected OTLP guidance still conflicts with the obsolete documentation in the chart values file.

1 open finding
What changed in this PR

Removes misleading host.name telemetry from pod-network control-plane components and corrects OTLP endpoint documentation.

Changes:

  • Adds caller-controlled host detection and applies it to registrar, controller, and edge telemetry.
  • Centralizes manager-to-telemetry configuration mapping.
  • Adds regression tests and updates observability documentation.
File Description
registrar/​internal/​cmd/​telemetry_test.go Tests registrar resource attributes.
registrar/​internal/​cmd/​config.go Disables registrar host detection.
registrar/​internal/​cmd/​BUILD.bazel Registers telemetry test dependencies.
controller/​internal/​cmd/​telemetry_test.go Tests controller resource attributes.
controller/​internal/​cmd/​config.go Disables controller host detection.
controller/​internal/​cmd/​BUILD.bazel Registers telemetry test dependencies.
agent/​internal/​cmd/​telemetry_test.go Tests agent and edge host behavior.
agent/​internal/​cmd/​root.go Applies edge-specific telemetry configuration.
agent/​internal/​cmd/​edge.go Defines edge host-detection behavior.
agent/​internal/​cmd/​BUILD.bazel Registers telemetry test dependencies.
common/​telemetry/​setup/​setup.go Adds configurable host omission and exports resource creation.
common/​telemetry/​setup/​logs.go Uses the shared resource builder.
common/​telemetry/​setup/​tracing.go Uses the shared resource builder.
common/​telemetry/​setup/​resource_test.go Tests both host-detection modes.
common/​manager/​config.go Centralizes telemetry configuration mapping.
common/​manager/​config_test.go Tests the configuration mapping.
common/​manager/​manager.go Uses centralized telemetry configuration.
common/​manager/​logging.go Uses centralized logging resource configuration.
common/​manager/​BUILD.bazel Includes the new configuration test.
docs/​observability/​metric-labels.md Documents host attributes per component.
docs/​getting-started.md Corrects OTLP endpoint behavior.
docs/​configuration.md Corrects endpoint and host-name documentation.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/getting-started.md Resolved
@bpalermo
bpalermo merged commit 87f12bf into main Oct 9, 2026
31 checks passed
@bpalermo
bpalermo deleted the fix/1596-host-name-non-hostnetwork branch October 9, 2026 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

observability Metrics, logs, profiles, alerts

Projects

None yet

2 participants