-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(browser): Ensure propagated parentSpanId
stays consistent during trace in TwP mode
#17526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
parentSpanId
stays consistent in TwP modeparentSpanId
stays consistent during trace in TwP mode
size-limit report 📦
|
afe61cf
to
e84c9be
Compare
node-overhead report 🧳Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.
|
parentSpanId
stays consistent during trace in TwP modeparentSpanId
stays consistent during trace in TwP mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test confused me a bit, so I just added some comments. No change for consistent trace sampling!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! also thanks for refactoring the helper methods
This PR adjusts how we set treat the
parentSpanId
when propagating it in an SDK configured for tracing without performance. Previously, we didn't set thepropagationSpanId
on thepropagationContext
(which is supposed to be serialized to the parent span id in thesentry-trace
(andtraceparent
) header, if no active span is present.This had the consequence that every time
getTraceData()
was called, we'd return a new, random (non-existing) parent span id. Meaning, that if we generate both,sentry-trace
andtraceparent
headers viagetTraceData()
they'd end up with different parent span ids in the respective hedaers.With this change, we now set a
propagationSpanId
on the PC, which has two effects:sentry-trace
andtraceparent
headers for the same outgoing requestSo this prolongs the time span in which we propagate the same parent span id. Since this span doesn't exist, I think this is fine. Though happy to drop this if reviewers have concerns. The main benefit with this change is 1 in combination with us generating
traceparent
from raw data rather than parsing the already generatedsentry-trace
header and converting its parts intotraceparent
.(TwP was a mistake)