Skip to content

Standardize OpenTelemetry environment variable naming#1292

Open
Daniel-Vaz wants to merge 3 commits intokagent-dev:mainfrom
Daniel-Vaz:cleanup-otel-env-vars-logic
Open

Standardize OpenTelemetry environment variable naming#1292
Daniel-Vaz wants to merge 3 commits intokagent-dev:mainfrom
Daniel-Vaz:cleanup-otel-env-vars-logic

Conversation

@Daniel-Vaz
Copy link

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

  • Updated _utils.py to 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)
  • Maintained backward compatibility with legacy variable names
  • Both now fall back to OTEL_EXPORTER_OTLP_ENDPOINT as per OpenTelemetry spec

Helm

  • Controller ConfigMap: Implemented smart endpoint configuration
    • Uses OTEL_EXPORTER_OTLP_ENDPOINT when tracing and logging endpoints are identical
    • Uses signal-specific endpoints (OTEL_EXPORTER_OTLP_TRACES_ENDPOINT / OTEL_EXPORTER_OTLP_LOGS_ENDPOINT) when different
  • QueryDoc ConfigMap: Added OTEL_EXPORTER_OTLP_TRACES_ENDPOINT for consistency

Copilot AI review requested due to automatic review settings February 13, 2026 09:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_ENDPOINT for 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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant