Repository navigation
feat(sandbox-env): opt-in daemon OTLP metrics endpoint - #5340
pedrofrxncx wants to merge 1 commit into
Conversation
Wires the chart side of the daemon's MeterProvider: when `telemetry.otlpEndpoint` is set, inject OTEL_EXPORTER_OTLP_ENDPOINT and OTEL_SERVICE_NAME into the sandbox container. Empty by default, which is what the daemon already treats as "register no provider" — so this is additive and inert until an operator opts in. Endpoint-agnostic on purpose: the value belongs in the per-env values, not here. But picking one is not free, so values.yaml carries the constraint that will otherwise cost someone an afternoon — netinit's iptables REJECTs the RFC1918 blockCIDRs BEFORE the port ACCEPTs, so a collector on an in-cluster ClusterIP is unreachable no matter which port is added to allowedTCPPorts, and every export is dropped silently. An address that clears that rule (e.g. the collector's LoadBalancer on the already-allowed 443) needs no netinit change at all. Also notes the trust consequence: this opens a path from pods running untrusted user code to the collector.
|
|
Retargeting: the metrics this chart knob enables moved to a log line in #5346, which needs no endpoint and no egress decision. This PR now only matters if we want OTLP push from sandbox pods as a platform capability — see the discussion on #5339, which is in draft pending that. Holding here rather than merging a knob nothing sets. |
|
Closing as stale: this PR sat past the bot's 48h merge window, main has moved on, and its CI results no longer reflect the current base. This is a housekeeping close, not a rejection of the change — if the underlying problem still exists, the bot will find it again and open a fresh, rebased PR. [studio-bot:stale-close] |
Chart side of #5339. That PR gives the daemon a
MeterProviderthat stays dormant withoutOTEL_EXPORTER_OTLP_ENDPOINT; this one lets an operator set it.Renders nothing when empty; injects both env vars when set. Verified with
helm templateboth ways,helm lintclean.Endpoint-agnostic on purpose — the actual URL belongs in the per-env values in
deco-apps-cd, not in the chart. That's also why this isn't blocked on deciding which collector address to use: the chart change is identical for every option.The constraint that makes this non-obvious
values.yamlnow documents it, because getting it wrong fails silently — every export is dropped and the dashboard just stays empty. Sandbox egress is the netinit iptables init container, not a NetworkPolicy, and it appends:The CIDR REJECT fires before the port ACCEPTs. A collector on an in-cluster ClusterIP lands in RFC1918, i.e. inside
blockCIDRs, so it is unreachable no matter which port is added toallowedTCPPorts—gateway-otlpis172.20.146.131, inside172.16.0.0/12. Reaching a ClusterIP would need a destination-scoped ACCEPT inserted ahead of theblockCIDRsloop, which this PR does not add.An address that already clears the rule needs no netinit change:
gateway-otlp-ingestis a LoadBalancer on443:32184/TCP, and 443 is already inallowedTCPPorts. That's the recommended value, pending confirmation of what auth that listener expects.Also noted in values: enabling this opens a path from pods running untrusted user code to the collector, so a compromised sandbox can emit arbitrary series. The daemon only ever sends fixed instrument names with derived attribute values.
Notes
0.9.33→0.9.34, changelog entry added (the publish workflow skips existing versions).Summary by cubic
Adds an opt-in OTLP metrics endpoint for the sandbox daemon. Default behavior stays the same until you set
telemetry.otlpEndpoint.New Features
OTEL_EXPORTER_OTLP_ENDPOINTandOTEL_SERVICE_NAMEwhentelemetry.otlpEndpointis set (chart v0.9.34; README/values updated).Migration
telemetry.otlpEndpointto a collector address reachable past netinit. In-cluster ClusterIP is blocked by RFC1918 REJECT; use the collector’s LoadBalancer on 443 or adjust netinit. Enabling allows sandbox pods to reach your collector.Written for commit 909f30c. Summary will update on new commits.