Standardize OpenTelemetry environment variable naming#1292
Standardize OpenTelemetry environment variable naming#1292Daniel-Vaz wants to merge 3 commits intokagent-dev:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR standardizes OpenTelemetry OTLP endpoint environment variable naming across kagent-core and Helm charts to align with the official OTel spec, while retaining legacy fallbacks in the Python runtime to address the configuration mismatch reported in #1273.
Changes:
- Updated Python OTel configuration to prefer signal-specific standard env vars (
OTEL_EXPORTER_OTLP_{TRACES,LOGS}_ENDPOINT) with legacy and general fallback. - Updated controller Helm ConfigMap to use a unified endpoint when trace/log endpoints match, otherwise emit signal-specific endpoints.
- Updated QueryDoc Helm ConfigMap to include
OTEL_EXPORTER_OTLP_TRACES_ENDPOINTfor consistency.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| python/packages/kagent-core/src/kagent/core/tracing/_utils.py | Prefer standard OTel env vars for trace/log endpoints with backward-compatible fallbacks. |
| helm/kagent/templates/controller-configmap.yaml | Emit unified vs signal-specific OTLP endpoint env vars based on whether trace/log endpoints are equal. |
| helm/tools/querydoc/templates/configmap.yaml | Add OTEL_EXPORTER_OTLP_TRACES_ENDPOINT alongside existing OTLP env vars. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
47c277a to
9632cdd
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: dvaz-external <dvaz.external@epo.org>
Signed-off-by: dvaz-external <dvaz.external@epo.org>
Signed-off-by: dvaz-external <dvaz.external@epo.org>
9632cdd to
ecb3e57
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
This PR addresses the OpenTelemetry configuration inconsistency reported in #1273 by standardizing environment variable naming to follow the official OpenTelemetry specification.
Changes Made
kagent-core
_utils.pyto check standard OpenTelemetry environment variables first:OTEL_EXPORTER_OTLP_TRACES_ENDPOINT(standard) →OTEL_TRACING_EXPORTER_OTLP_ENDPOINT(legacy fallback)OTEL_EXPORTER_OTLP_LOGS_ENDPOINT(standard) →OTEL_LOGGING_EXPORTER_OTLP_ENDPOINT(legacy fallback)OTEL_EXPORTER_OTLP_ENDPOINTas per OpenTelemetry specHelm
OTEL_EXPORTER_OTLP_ENDPOINTwhen tracing and logging endpoints are identicalOTEL_EXPORTER_OTLP_TRACES_ENDPOINT/OTEL_EXPORTER_OTLP_LOGS_ENDPOINT) when differentOTEL_EXPORTER_OTLP_TRACES_ENDPOINTfor consistency