Skip to content

Conversation

@Lms24
Copy link
Member

@Lms24 Lms24 commented Nov 26, 2025

For the "Next Trace" button, we'd previously, search for spans matching the exact trace and span id of the current trace root span. However, in some cases, the product considers another span the trace root span than our SDK. An example is a web vital (INP) span, which happened slightly before the navigation span started but was only added by the SDK retroactively. In the product, we consider the web vital span the trace root, while in the SDK we assigned the previous_trace span link to the navigation span.

To still correctly find the next trace span, this PR now relaxes the search criteria for the next trace, to search for a span with the previous_trace attribute containing the current trace's traceId, but any spanId. This works well as long as there's only one previous_trace span link per trace. If there are multiple, we'd take the first one, which also isn't the end of the world. However, in the SDK, we make sure to only set the link once per trace. => I think this works well enough.

h/t @bcoe for the "contains" idea 🙏

@Lms24 Lms24 requested a review from a team as a code owner November 26, 2025 15:50
@Lms24 Lms24 changed the title fix(waterfall): Relax "next_trace" lookup to only the trace id fix(waterfall): Relax "next_trace" lookup to just the trace id Nov 26, 2025
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 26, 2025
@Lms24 Lms24 merged commit 64ca9a6 into master Nov 27, 2025
50 checks passed
@Lms24 Lms24 deleted the lms/fix-linkedTraces-next-trace-lookup branch November 27, 2025 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants