Skip to content

feat: update EnvironmentGetter and EnvironmentSetter to use normalized environment variable names#5119

Merged
xrmx merged 5 commits into
open-telemetry:mainfrom
herin049:feat/revise-env-carrier
May 8, 2026
Merged

feat: update EnvironmentGetter and EnvironmentSetter to use normalized environment variable names#5119
xrmx merged 5 commits into
open-telemetry:mainfrom
herin049:feat/revise-env-carrier

Conversation

@herin049

Copy link
Copy Markdown
Contributor

Description

Update the EnvironmentGetter and EnvironmentSetter classes to normalize environment variable names based on the updated environment variable spec.

Fixes #5097

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

uv run tox -e py314-test-opentelemetry-api

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@herin049
herin049 requested a review from a team as a code owner April 17, 2026 04:21

@MikeGoldsmith MikeGoldsmith 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.

Looks good, thanks @herin049 🚀

@github-project-automation github-project-automation Bot moved this to Approved PRs in Python PR digest Apr 17, 2026
@herin049
herin049 force-pushed the feat/revise-env-carrier branch from 715ed3a to c4b6e89 Compare April 29, 2026 21:20
@xrmx
xrmx merged commit 2397a22 into open-telemetry:main May 8, 2026
480 checks passed
@github-project-automation github-project-automation Bot moved this from Approved PRs to Done in Python PR digest May 8, 2026
pellared added a commit to pellared/opentelemetry-specification that referenced this pull request May 20, 2026
hilmarf pushed a commit to apeirora/opentelemetry-specification that referenced this pull request Jun 1, 2026
pellared added a commit to cijothomas/opentelemetry-specification that referenced this pull request Jun 2, 2026
…y#5102)

Towards
open-telemetry#5040

## Changes

Clarifies the environment variable propagation carrier key normalization
requirements:

- `Set` writes values using normalized key names.
- `Get` normalizes both the requested propagator key and carrier keys
before matching.
- `Keys` returns normalized key names.

## Motivation

The existing text defined how key names are normalized, but it did not
explicitly say where that normalization applies. This PR clarifies that
normalization is part of the carrier behavior for writing, reading, and
listing keys.

This follows the robustness principle: carriers write the normalized
representation, while getters can still accept a non-normalized
environment variable key if it normalizes to the requested propagation
key. For example, a non-normalized `traceparent` environment variable
can still be used by the propagation getter when matching `TRACEPARENT`.

This retrospects
open-telemetry#4944 (comment)
now that implementations are in place.

## Implementation references

- Go:
open-telemetry/opentelemetry-go-contrib#8761
- .NET: open-telemetry/opentelemetry-dotnet#7174
- Java: open-telemetry/opentelemetry-java#8233
- Python:
open-telemetry/opentelemetry-python#5119
- Swift:
open-telemetry/opentelemetry-swift-core#47

Related Java discussion:
open-telemetry/opentelemetry-java#8233 (comment)
dashpole pushed a commit to dashpole/opentelemetry-specification that referenced this pull request Jun 8, 2026
…y#5102)

Towards
open-telemetry#5040

## Changes

Clarifies the environment variable propagation carrier key normalization
requirements:

- `Set` writes values using normalized key names.
- `Get` normalizes both the requested propagator key and carrier keys
before matching.
- `Keys` returns normalized key names.

## Motivation

The existing text defined how key names are normalized, but it did not
explicitly say where that normalization applies. This PR clarifies that
normalization is part of the carrier behavior for writing, reading, and
listing keys.

This follows the robustness principle: carriers write the normalized
representation, while getters can still accept a non-normalized
environment variable key if it normalizes to the requested propagation
key. For example, a non-normalized `traceparent` environment variable
can still be used by the propagation getter when matching `TRACEPARENT`.

This retrospects
open-telemetry#4944 (comment)
now that implementations are in place.

## Implementation references

- Go:
open-telemetry/opentelemetry-go-contrib#8761
- .NET: open-telemetry/opentelemetry-dotnet#7174
- Java: open-telemetry/opentelemetry-java#8233
- Python:
open-telemetry/opentelemetry-python#5119
- Swift:
open-telemetry/opentelemetry-swift-core#47

Related Java discussion:
open-telemetry/opentelemetry-java#8233 (comment)
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.

Revise env carrier propagator

4 participants