Describe the bug
JaegerPropagator.extract() erases baggage that an earlier propagator already extracted when the jaeger-baggage header contains no parsable key=value entry.
Steps to reproduce
Configure otel.propagators=tracecontext,baggage,jaeger and send a request with both a valid W3C baggage header and a jaeger-baggage header that has no parsable entry (user=, an empty value, or nometa+novalue). The W3C baggage is gone from the extracted context.
What did you expect to see?
The existing baggage preserved. Three siblings already guard this: the uberctx- branch of the same method only creates a builder when it puts an entry, OtTracePropagator.extract() guards with if (!baggage.isEmpty()), and W3CBaggagePropagator.extractMulti() returns the context unchanged when it extracted nothing.
What did you see instead?
Baggage.empty(). JaegerPropagator.getBaggageFromHeader() (line 281) creates a builder whenever the header value is non-null, so line 294 returns an empty but non-null Baggage. extract() (line 166) stores it, and Baggage.storeInContext() replaces the previous value unconditionally.
What version and what artifacts are you using?
Artifacts: opentelemetry-extension-trace-propagators
Version: main @ b86f040
Environment
Compiler: Temurin 21
OS: N/A
Additional context
Incomplete fix from #8380, which added the !baggage.isEmpty() guard to OtTracePropagator and the lazy builder to the uberctx- branch but left this branch. Nothing is logged when the baggage disappears.
Describe the bug
JaegerPropagator.extract()erases baggage that an earlier propagator already extracted when thejaeger-baggageheader contains no parsablekey=valueentry.Steps to reproduce
Configure
otel.propagators=tracecontext,baggage,jaegerand send a request with both a valid W3Cbaggageheader and ajaeger-baggageheader that has no parsable entry (user=, an empty value, ornometa+novalue). The W3C baggage is gone from the extracted context.What did you expect to see?
The existing baggage preserved. Three siblings already guard this: the
uberctx-branch of the same method only creates a builder when it puts an entry,OtTracePropagator.extract()guards withif (!baggage.isEmpty()), andW3CBaggagePropagator.extractMulti()returns the context unchanged when it extracted nothing.What did you see instead?
Baggage.empty().JaegerPropagator.getBaggageFromHeader()(line 281) creates a builder whenever the header value is non-null, so line 294 returns an empty but non-nullBaggage.extract()(line 166) stores it, andBaggage.storeInContext()replaces the previous value unconditionally.What version and what artifacts are you using?
Artifacts: opentelemetry-extension-trace-propagators
Version: main @ b86f040
Environment
Compiler: Temurin 21
OS: N/A
Additional context
Incomplete fix from #8380, which added the
!baggage.isEmpty()guard toOtTracePropagatorand the lazy builder to theuberctx-branch but left this branch. Nothing is logged when the baggage disappears.