Repository navigation
feat(tracing): adopt an edge's trace id without parenting its span - #66
Merged
Merged
Conversation
Load balancers and proxies often inject a traceparent on every request so their access log joins the backend's trace, while exporting no span of their own. Continuing that header made every request span the child of a span that never arrives, and trace backends listed those traces as missing their root. traces.continue_incoming_parent (default true, so behaviour is unchanged) turns that off: the request adopts the incoming trace id and sampled flag, starts as the root span, and links the span id the edge named. The trace id is kept so the edge's log still joins, and the reference is kept as a link rather than dropped.
sylvesterdamgaard
force-pushed
the
feat/edge-injected-traceparent
branch
from
October 1, 2026 20:30
b07d2c4 to
3be0484
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Load balancers and proxies often inject a
traceparenton every request, so their access log carries a trace id that joins the backend's trace, while exporting no span of their own. Continuing that header makes every request span the child of a span that never arrives, and trace backends list those traces as missing their root. We hit this in production behind HAProxy: every app trace in Tempo showed up as "root span not yet received".What changes
traces.continue_incoming_parent(TELEMETRY_TRACES_CONTINUE_INCOMING_PARENT), defaulttrue. With the default, nothing changes.false, the request adopts the incoming trace id and sampled flag (still subject totrust_incoming_sampling) but starts as the root span. The span id the edge named is kept as a span link instead of a parent, so the edge's log line still joins the trace and the reference isn't silently dropped.Tracer::adoptTraceId()sits next tocontinueFrom();TraceRequestpicks between them.Tests
Three new cases in
RequestInstrumentationTest:composer checkis green (Pint, PHPStan, full suite).Docs
traces.mdhas a new "Behind an edge that injects traceparent" section.llms.txtand the CHANGELOG (Unreleased/Added).