You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OtTracePropagator extracts an empty baggage key from an ot-baggage- header #8629
Describe the bug OtTracePropagator.extract() creates a baggage entry with an empty string key when the carrier contains a header named exactly ot-baggage- (the prefix with no key after it).
Steps to reproduce
Extract from a carrier holding a valid OT span context plus a header keyed ot-baggage-:
What did you expect to see? Baggage.empty(). The sibling JaegerPropagator.getBaggageFromHeader() skips a header that is only the uberctx- prefix, and JaegerPropagatorTest.extract_baggageOnly_withPrefix_emptyKey asserts that contract. W3CBaggagePropagator.isValidBaggageKey() also treats an empty key as invalid.
What did you see instead?
A baggage entry keyed "". OtTracePropagator.extract() line 149 only checks startsWith, so substring at line 156 yields "" and line 161 puts it. The ImmutableKeyValuePairs Javadoc makes removing empty keys the caller's responsibility. A later inject() re-emits the entry, so it keeps propagating and consumes the 64-entry budget.
What version and what artifacts are you using?
Artifacts: opentelemetry-extension-trace-propagators
Version: main @ b86f040
How did you reference these artifacts? implementation("io.opentelemetry:opentelemetry-extension-trace-propagators")
Activity