Skip to content

Do not attempt to enumerate or normalize entries from carrier#8474

Merged
jack-berg merged 3 commits into
open-telemetry:mainfrom
jack-berg:updated-env-var-propagation
Jun 16, 2026
Merged

Do not attempt to enumerate or normalize entries from carrier#8474
jack-berg merged 3 commits into
open-telemetry:mainfrom
jack-berg:updated-env-var-propagation

Conversation

@jack-berg

Copy link
Copy Markdown
Member

open-telemetry/opentelemetry-specification#5144

  • keys now only returns entries from the carrier that are already normalized
  • get normalizes the requested key, and tries to fetch it as is from the carrier, but does not attempt to enumerate / normalize any entries in the carrier
  • set normalizes entries before adding to carrier

cc @pellared - I think this is the intent of the spec PR

@pellared

Copy link
Copy Markdown
Member

This is correct. Just the tests need to be updated 😉

@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 78.54%. Comparing base (327f564) to head (e796c9f).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...y/api/incubator/propagation/EnvironmentSetter.java 91.66% 0 Missing and 1 partial ⚠️

❌ Your project check has failed because the head coverage (78.24%) is below the target coverage (89.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@              Coverage Diff              @@
##               main    #8474       +/-   ##
=============================================
- Coverage     91.04%   78.54%   -12.50%     
- Complexity     7822     8474      +652     
=============================================
  Files           893     1008      +115     
  Lines         23721    28830     +5109     
  Branches       2364     3570     +1206     
=============================================
+ Hits          21596    22645     +1049     
- Misses         1407     5341     +3934     
- Partials        718      844      +126     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jack-berg jack-berg marked this pull request as ready for review June 11, 2026 19:15
@jack-berg jack-berg requested a review from a team as a code owner June 11, 2026 19:15
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.
…pagation/EnvironmentSetter.java

Co-authored-by: Jay DeLuca <jaydeluca4@gmail.com>
@jack-berg jack-berg merged commit 4c4e8ec into open-telemetry:main Jun 16, 2026
44 of 47 checks passed
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.

3 participants