Skip to content

opentelemetry-api: update EnvironmentGetter to ignore non-normalized environment variable names#5289

Merged
xrmx merged 8 commits into
open-telemetry:mainfrom
pellared:envvar-car-change
Jun 17, 2026
Merged

opentelemetry-api: update EnvironmentGetter to ignore non-normalized environment variable names#5289
xrmx merged 8 commits into
open-telemetry:mainfrom
pellared:envvar-car-change

Conversation

@pellared

@pellared pellared commented Jun 11, 2026

Copy link
Copy Markdown
Member

@pellared
pellared marked this pull request as ready for review June 11, 2026 10:12
@pellared
pellared requested a review from a team as a code owner June 11, 2026 10:12
cijothomas pushed a commit to cijothomas/opentelemetry-specification that referenced this pull request Jun 12, 2026
…etry#5144)

Fixes
open-telemetry#5143

Prototypes: 
- open-telemetry/opentelemetry-go-contrib#9112
- open-telemetry/opentelemetry-cpp#4141
- open-telemetry/opentelemetry-java#8474
- open-telemetry/opentelemetry-js#6774
- open-telemetry/opentelemetry-python#5289
- open-telemetry/opentelemetry-swift-core#83

### Rationale

The previous wording required environment variable carriers to normalize
every key present in the carrier before matching a requested propagation
key.

This PR removes that requirement for two reasons:

- **Efficiency**: extraction should not require reading every
environment variable
- **Determinism**: if multiple environment variable names normalize to
the same key, selecting one is ambiguous and implementation-dependent.

Instead, carriers normalize the key requested by the propagator and read
only the corresponding normalized environment variable name. `Keys`
similarly returns only environment variable names that are already
normalized.

This keeps injection behavior unchanged while making extraction
predictable and avoiding unnecessary environment enumeration.

@pmcollins pmcollins left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM -- thanks @pellared.

@github-project-automation github-project-automation Bot moved this to Approved PRs in Python PR digest Jun 12, 2026
@xrmx xrmx moved this from Approved PRs to Ready for merge in Python PR digest Jun 17, 2026
@xrmx
xrmx added this pull request to the merge queue Jun 17, 2026
Merged via the queue into open-telemetry:main with commit 1ccd0a1 Jun 17, 2026
519 checks passed
@github-project-automation github-project-automation Bot moved this from Ready for merge to Done in Python PR digest Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants