feat(helm): expose OTEL headers, service name, and resource attributes#2272
Open
shekhargit1912 wants to merge 2 commits into
Open
feat(helm): expose OTEL headers, service name, and resource attributes#2272shekhargit1912 wants to merge 2 commits into
shekhargit1912 wants to merge 2 commits into
Conversation
The controller already honors the standard OpenTelemetry SDK env vars, but the chart had no way to set them, leaving authenticated OTLP backends (Langfuse Cloud, Honeycomb, Datadog, Grafana Cloud, New Relic) unreachable without post-render hacks. Add optional values, all rendered into the controller ConfigMap only when set so existing installs render identically: - otel.tracing.exporter.otlp.headers -> OTEL_EXPORTER_OTLP_TRACES_HEADERS - otel.logging.exporter.otlp.headers -> OTEL_EXPORTER_OTLP_LOGS_HEADERS - otel.serviceName -> OTEL_SERVICE_NAME - otel.resourceAttributes -> OTEL_RESOURCE_ATTRIBUTES Header and attribute maps render as comma-joined key=value pairs with sorted keys, matching the DEFAULT_AGENT_POD_LABELS pattern. Secret header values should instead be injected via controller.env/envFrom, as documented in values.yaml. Fixes kagent-dev#2126 Signed-off-by: shekhargit1912 <shekharchaugule302@gmail.com>
Signed-off-by: Shekhar Chaugule <79699567+shekhargit1912@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the helm/kagent chart to expose additional standard OpenTelemetry SDK environment variables (service name, resource attributes, and OTLP headers) via values.yaml, rendering them into the controller ConfigMap only when configured to preserve backwards-compatible output.
Changes:
- Added
otel.serviceNameandotel.resourceAttributesvalues, mapping toOTEL_SERVICE_NAMEandOTEL_RESOURCE_ATTRIBUTES. - Added
otel.tracing.exporter.otlp.headersandotel.logging.exporter.otlp.headers, mapping toOTEL_EXPORTER_OTLP_TRACES_HEADERSandOTEL_EXPORTER_OTLP_LOGS_HEADERS, serialized as sortedk=vpairs. - Added Helm chart tests to validate absence-by-default and deterministic sorted rendering when set.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| helm/kagent/values.yaml | Adds new OTEL-related values with guidance about avoiding plaintext secrets in ConfigMaps. |
| helm/kagent/templates/controller-configmap.yaml | Conditionally renders the new OTEL env vars into the controller ConfigMap using sorted k=v serialization. |
| helm/kagent/tests/controller-deployment_test.yaml | Adds assertions covering default non-rendering and correct sorted rendering of the new fields. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
The controller already honors the standard OpenTelemetry SDK env vars, but the chart had no way to set them, leaving authenticated OTLP backends (Langfuse Cloud, Honeycomb, Datadog, Grafana Cloud, New Relic) unreachable without post-render hacks.
Add optional values, all rendered into the controller ConfigMap only when set so existing installs render identically:
Header and attribute maps render as comma-joined key=value pairs with sorted keys, matching the DEFAULT_AGENT_POD_LABELS pattern. Secret header values should instead be injected via controller.env/envFrom, as documented in values.yaml.
Fixes #2126