Repository navigation
feat(helm): authenticate OTLP log export to a hosted collector - #5
Merged
Merged
Conversation
`server.otlp.endpoint` can already point the gateway at a collector, but there is no way to authenticate to one. Any hosted collector needs a credential, and the gateway TOML has no `headers` field, so the only route into the process is the standard OpenTelemetry environment variable. Adds `server.otlp.headersSecret`, naming an existing Secret that holds the full header string, for example `authorization=ApiKey <token>`. The value reaches the gateway as OTEL_EXPORTER_OTLP_HEADERS via secretKeyRef, so the token is never a chart value, never a rendered manifest literal, and never visible to `helm get values`. Inert unless `headersSecret.name` is set: with it empty the env var is not emitted at all, so existing deployments render byte-identically. `key` defaults to OTEL_EXPORTER_OTLP_HEADERS and can be overridden for a Secret that already carries the string under another name. Without this, exporting to anything other than an unauthenticated in-cluster collector is not expressible, which in practice means a fleet running on this chart has no telemetry it can ship anywhere durable. Signed-off-by: clippy <matt@monad.com> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ReW6fW9rodn627GJ8a63S9 Signed-off-by: clippy <matt@monad.com>
3 tasks done
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.
Summary
server.otlp.endpointcan already point the gateway at a collector, but there isno way to authenticate to one. Any hosted collector requires a credential,
and the gateway TOML has no
headersfield, so the only route into the processis the standard OpenTelemetry environment variable.
This adds
server.otlp.headersSecret, naming an existing Secret that holds thefull header string — for example
authorization=ApiKey <token>.Without it, exporting anywhere other than an unauthenticated in-cluster collector
is not expressible, which in practice means a fleet on this chart has no
telemetry it can ship somewhere durable.
Related Issue
No issue. Small, additive chart change, inert by default.
Changes
values.yaml—server.otlp.headersSecret.{name,key}templates/_gateway-workload.tpl— emitsOTEL_EXPORTER_OTLP_HEADERSviasecretKeyRefwhennameis setREADME.md— regenerated byhelm-docsThe token is never a chart value, never a rendered manifest literal, and never
visible to
helm get values.This relies on documented gateway behaviour rather than an assumption.
crates/openshell-server/src/otel_tracing.rsstates it explicitly: the TOMLtable decides whether and where to export, while how — including transport
headers — is the SDK's
OTEL_*surface, and"
OTEL_EXPORTER_OTLP_HEADERS/OTEL_EXPORTER_OTLP_LOGS_HEADERSstill apply."Testing
mise run helm:lint— passes, all variants.mise run helm:docs:check— passes. The README is generated, and thehand-written
# --comments invalues.yamlproduce exactly whathelm-docsemits, so the committed README is in sync.
headersSecret.nameempty the env var is notemitted at all. Rendering the chart with default values yields zero
occurrences, so existing deployments render byte-identically.
keyis honoured.headersSecret: nullrenders cleanly rather than erroring.openshell-gatewaycontainer of theStatefulSet, and nowhere else.
Checklist
helm-docs, check passeskeyOne deliberate behaviour worth noting
If
headersSecret.namepoints at a Secret that does not exist, the pod will notstart. That is a
secretKeyRefwithoutoptional: true, and it is the intendedfailure mode: a gateway that silently starts without its collector credential
exports nothing, and the resulting silence is indistinguishable from an idle
system. Failing to start is louder and easier to diagnose.
🤖 Generated with Claude Code
https://claude.ai/code/session_01ReW6fW9rodn627GJ8a63S9