Skip to content

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

Open
jack-berg wants to merge 2 commits into
open-telemetry:mainfrom
jack-berg:updated-env-var-propagation
Open

Do not attempt to enumerate or normalize entries from carrier#8474
jack-berg wants to merge 2 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 91.04%. Comparing base (327f564) to head (48a1f0a).

Files with missing lines Patch % Lines
...y/api/incubator/propagation/EnvironmentSetter.java 91.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8474   +/-   ##
=========================================
  Coverage     91.04%   91.04%           
- Complexity     7822     7828    +6     
=========================================
  Files           893      893           
  Lines         23721    23727    +6     
  Branches       2364     2365    +1     
=========================================
+ Hits          21596    21602    +6     
+ Misses         1407     1406    -1     
- Partials        718      719    +1     

☔ 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
Comment on lines +69 to +78
/**
* Determine if a key is a valid normalized environment variable name.
*
* <ul>
* <li>ASCII letters are converted to uppercase
* <li>Any character that is not an ASCII letter, digit, or underscore is replaced with an
* underscore (including {@code .}, {@code -}, whitespace, and control characters)
* <li>Does not start with a digit
* </ul>
*/

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.

I think this could be reworded to sound a bit more like a predicate

Suggested change
/**
* Determine if a key is a valid normalized environment variable name.
*
* <ul>
* <li>ASCII letters are converted to uppercase
* <li>Any character that is not an ASCII letter, digit, or underscore is replaced with an
* underscore (including {@code .}, {@code -}, whitespace, and control characters)
* <li>Does not start with a digit
* </ul>
*/
/**
* Determine if a key is a valid normalized environment variable name. Returns {@code true} if
* {@code key} is non-empty, contains only uppercase ASCII letters, digits, and underscores, and
* does not start with a digit.
*/

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