Skip to content

Do not link current span when propagation headers are missing#18154

Merged
trask merged 1 commit into
open-telemetry:mainfrom
trask:span-links-builder
Apr 22, 2026
Merged

Do not link current span when propagation headers are missing#18154
trask merged 1 commit into
open-telemetry:mainfrom
trask:span-links-builder

Conversation

@trask

@trask trask commented Apr 22, 2026

Copy link
Copy Markdown
Member

PropagatorBasedSpanLinksExtractor used the caller-provided parentContext
as the fallback for TextMapPropagator.extract, which meant that when a
message carried no propagation headers the extractor would link the new
span to the ambient parent (e.g. a CONSUMER receive span). Use
Context.root() internally so that missing headers result in no link
being added, and remove the now-redundant Context.root() overrides and
stale comments in the batch extractors for kafka-clients, kafka-connect
and pulsar. Document the invariant on SpanLinksExtractor.
@trask
trask requested a review from a team as a code owner April 22, 2026 04:05
@trask
trask merged commit 6a8fc50 into open-telemetry:main Apr 22, 2026
93 checks passed
@trask
trask deleted the span-links-builder branch April 22, 2026 19:28
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.

2 participants