Repository navigation
feat(cni)!: drop the OTel SDK from the CNI plugin; forward its timings to the agent (#1166) - #1185
Merged
Merged
Conversation
…s to the agent (#1166) The plugin linked the OTel SDK, the OTLP trace/metric exporters and otelgrpc (18 of its 37 modules, 3.2 MB) and flushed them before every exit. Measured per pod ADD/DEL: +7.6 ms wall p50 with a reachable collector, +2.0 s with an unreachable or unresolvable one (the #950 state). Nothing queried its spans, and no incident was diagnosed from them. The one consumed signal, the capture-divert counter (the soak gate), now reaches Prometheus through the agent under the same name and labels. - api/aether/cni/v1: additive PluginTimings{started, pre_call} on AddPod and RemovePod, plus a ReportAddResult RPC for the post-AddPod readiness probe and capture divert. An older agent answers UNIMPLEMENTED (ignored); an older plugin sends nothing. - agent: records the timings as span attributes, counts aether.cni.operations{capture_divert}, and WARNs on an uncaptured pod. - cni-install: writes no otlp_endpoint; --otlp-endpoint/--otlp-pin-endpoint become deprecated no-ops for one release. - chart 2.4.0: cniInstall.otlpEndpoint / pinOTLPEndpoint removed. - deps_test allow-list and budget 37 -> 19, OTel forbidden, ceiling 18 MiB. Fixes #1166 Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
bpalermo
force-pushed
the
feat/1166-cni-tracing
branch
from
October 4, 2026 11:10
f120876 to
fb5f04f
Compare
bpalermo
added a commit
that referenced
this pull request
Oct 4, 2026
…from the last two days (#1235) - proxy-supervisor: drop "15 MiB / 24 modules" (it links 25 since the OTel 1.47 bump, #1215) and name deps_test + check-proxy-supervisor-deps.sh as the source of truth; that guard asserts forbidden packages and a size ceiling, not a count. - cni: the allow-list budget is 19, not 37 (#1185). Point at the guard's maxModules instead of repeating it; the build-graph script now forbids OpenTelemetry too. The plugin forwards timings to the agent. - mesh-dns: same wording (its guard asserts 30, still correct). - cni/internal: telemetry/ was removed by #1185. - registrar/internal/server: the snapshot version is store revision + content hash since #1204. - Add agent/internal/ownership (proposal 041), common/drain, common/referencegrant, and common/taint (in the node-taint entry). Fixes #1224 Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr Co-authored-by: Claude Fable 5.1 <[email protected]>
This was referenced Oct 9, 2026
Closed
bpalermo
added a commit
that referenced
this pull request
Oct 9, 2026
…onger report their pod name as host.name, and the otel.endpoint row no longer names the CNI plugin (#1596, #1614) (#1618) 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. Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr Co-authored-by: Claude Opus 5.5 <[email protected]>
This was referenced Oct 10, 2026
bpalermo
added a commit
that referenced
this pull request
Oct 10, 2026
…re of TCP and UDP, HTTP/3 between proxies, outcome-based retries, UDS over CSI, the surge-rolled agent (#1648) The architecture page is README.md and the landing page is website/pages/index.md; neither mentioned transparent capture, QUIC, UDP, L4 routes, the edge, retries or the data-plane ports. README.md (the site's Architecture page) - Intro and diagram: the CNI's TPROXY-style divert of TCP and UDP, the transports of a mesh hop (HTTP/3 over QUIC, HTTP/2, TCP; UDP in plaintext), the uds-csi node plugin. - New paragraphs: transparent capture, transport between proxies, retries, edge gateway, multi-cluster, data-plane ports. The agent paragraph names the ownership lock and the opt-in surge roll; the Gateway API paragraph names the L4 route types and the authz sidecar. - The CNI plugin exports no telemetry of its own (#1185); the observability paragraph said it did. website/pages/index.md (landing page) - "What it does today", eight entries, each linked to its doc or proposal. - The hot-restart cell said the agent supervises Envoy (it is the proxy supervisor since #772) and claimed zero drops measured by the prober; it now quotes proposal 042's write-up of the soak, the prober's mesh-DNS timeouts included. - The install block names the SPIRE prerequisite and the four privileged DaemonSets, as docs/getting-started.md does. docs - getting-started.md: the east-west QUIC text was a bullet of the edge section; it is its own subsection under "Call other services" (#east-west-quic), unchanged in content. The edge section gains the HTTP/3 switch (edge.config.http3.enabled, default off). The model diagram and its bullets name HTTP/3. - workload-requirements.md: one paragraph on what carries a request between proxies. - runbook.md: one per-pod cluster name spelled without its namespace (#1634). Site plumbing - docs/observability/metric-labels.md is staged as /docs/metric-labels/ and is in the nav; three staged pages linked it on GitHub. Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr 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.
Decision: drop the OTel SDK from the CNI plugin
The plugin's spans carried almost nothing the agent's spans lack, nothing queried them, and no incident was diagnosed from them. The cost was paid on every pod ADD and DEL: about 6 ms with a reachable collector and 2 s with an unreachable one. The one signal something does consume, the
capture_divertcounter, now reaches Prometheus through the agent under the same metric name and labels.Value evidence
(a) What the plugin's telemetry carried that the agent's does not
cni.add_pod/cni.remove_podspans: the client-side RPC, with pod name/namespace/container idcni_server.enhance_pod/register_endpoint/xds_add_pod/envoy_ack_wait/xds_remove_pod/unregister_endpointsstep spans, with the same pod attributes.sendAddPod, after that work.aether.cni.operations{operation="capture_divert"}counter/histogram.cni.readiness_probespanaether.cni.operations{add,del,check,gc,status}+aether.cni.operation.durationrpc.server.*metrics count and time AddPod/RemovePod.(b) Consumers. Nothing in
docs/,docs/observability/, the chart, ork8s-talos-main/clusters/talos-main(Prometheus rules, rules_test, values, Grafana) references the plugin's span names (cni.add_pod,cni.readiness_probe,cni.remove_pod), its tracer (aether/cni-plugin) or its service (aether-cni). The only consumers of anything it exported:aether_cni_operations_total{aether_cni_operation="capture_divert",aether_cni_result="error"}(withaddas its existence proof) ine2e/soak/README.md;e2e/uds.shassertion f, which tested that the export itself worked (CNI plugin OTLP metrics never reach Prometheus on talos-main: host resolver cannot resolve the collector's cluster DNS name #950).There are no alerts and no dashboards on either.
(c) Incident history. #645 (conflist), #245 (stale netns), #484 (RESULT_IGNORED), #1094 (anyport landing), #950, #1088: zero mentions of a trace, span or Tempo across the bodies and comments. Those diagnoses came from
plugin.log, agent logs and Prometheus. #950 itself was diagnosed fromplugin.log, because the plugin's telemetry was the thing that was broken: it exported nothing on talos-main for weeks while each flush timed out.Cost (measured)
//cni/cmd/cnibuilt as-is vs. this branch. A Go harness alternated the variants each iteration (n=300, 20-core host under load) and read the child's rusage. The DEL case uses akube-systempod: it parses the netconf, initialises telemetry, returns early, then records and flushes. That isolates the telemetry cost with no agent call.VERSION(init only), wall p50 / CPU p50The 2 s case is the 2 s OTLP export timeout.
Flushran before the plugin printed its result, so every pod start on talos-main waited that extra time before #950 was fixed.What changed
cni/internal/telemetry(SDK, OTLP trace and metric exporters),trace.go, the otelgrpc client stats handler and theinstrument/Flushwrapper. It links nogo.opentelemetry.iomodule now.api/aether/cni/v1/service.proto, edition 2023, implicit presence, additive only):PluginTimings{started, pre_call}onAddPodRequest(field 2) andRemovePodRequest(field 5);ReportAddResultRPC for what happens after AddPod answers (readiness probe and capture divert durations and errors, plus total). The capture divert has to come after the agent's managed/ignored verdict, so it cannot ride on AddPod.UNIMPLEMENTED, which the plugin logs at DEBUG. The report is one attempt with a 500 ms timeout and never fails an ADD.aether.cni.plugin.{pre_call,readiness_probe,capture_divert,total}_seconds,…_error). It countsaether.cni.operations{aether.cni.operation="capture_divert", aether.cni.result}under the same name and labels the plugin exported, so the soak gate PromQL is unchanged. A failed divert also gets a WARN in the agent's log, which reaches VictoriaLogs; until now that WARN existed only in node-localplugin.log.otlp_endpointand drops the CNI plugin OTLP metrics never reach Prometheus on talos-main: host resolver cannot resolve the collector's cluster DNS name #950 ClusterIP pinning.--otlp-endpoint/--otlp-pin-endpointstay as deprecated no-ops for one release, so an older chart still starts a newer image. Old conflists that still carry the key are ignored, and cni-install rewrites the entry anyway.cniInstall.otlpEndpoint/cniInstall.pinOTLPEndpointremoved. The two render tests are replaced byaether_cni_no_otlp_test(absent test).//cni/cmd/cni:deps_testallow-list 37 → 19, budget 37 → 19,go.opentelemetry.io/added to the forbidden packages, size ceiling 24 → 18 MiB.scripts/check-cni-deps.shforbidsio_opentelemetry.docs/configuration.md, a new runbook troubleshooting section ("A pod started uncaptured…"), and the soak README gate (the existence proof is nowcapture_divertsuccess, and the counter is per agent process).e2e/uds.shassertion f now proves the divert outcome reaches the agent's Prometheus exporter after a fresh managed-pod ADD, with no error series and nootlp_endpointin the netconf. The suite's collector is gone.Lost
The plugin's own count of ADDs that never reached the agent (agent down). These remain visible as the kubelet's
FailedCreatePodSandBoxevent and inplugin.log. Nothing consumed the plugin-sideadderror series.Tests
bazel test --config=raceover//cni/...and//agent/internal/cni/...: pass. New tests:cni/internal/plugin/timings_test.goandagent/internal/cni/server/pluginreport_test.go.cni/config,cni/internal/install,common/telemetryand the chart: pass.bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //...: clean.make format-check,make gazelle,scripts/check-cni-deps.sh: clean.make deps-audit: OK (go.mod unchanged).e2e/uds.sh(up + verify): all assertions passed, including the rewritten (f): the netconf has nootlp_endpoint, a fresh managed ADD grew the agent'scapture_divertsuccess count 5 -> 6, and there is no error series. The node'splugin.loghas 0failed to reportand 0 otel/flush lines.Fixes #1166
🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr