Skip to content

feat(trace-view): Find the previous trace from its span link (not attribute) - #126702

Merged
s1gr1d merged 6 commits into
masterfrom
sig/linked-traces-update
Oct 9, 2026
Merged

s1gr1d merged 6 commits into
masterfrom
sig/linked-traces-update

Conversation

@s1gr1d

@s1gr1d s1gr1d commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Since #125741 we can filter sentry.links, which lets us improve "Previous trace". SDKs send the previous_trace link together with the sentry.previous_trace attribute.

  • "Previous trace" now reads the root span's previous_trace link instead of the attribute.
  • If the link has no sampling decision, the trace view still searches for the previous trace's span to check that it exists.
  • "Next trace" still searches the attribute. We can filter sentry.links, but only with a wildcard on private JSON, which cannot filter by link type or sampling. Removing the attribute needs links as EAP objects.

@s1gr1d
s1gr1d requested a review from a team as a code owner October 7, 2026 12:16
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 7, 2026
@s1gr1d
s1gr1d requested review from Lms24 and nsdeschenes October 7, 2026 12:17
@s1gr1d

s1gr1d commented Oct 7, 2026

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 37a4894. Configure here.

Base automatically changed from sig/frontend-serialized-links to master October 7, 2026 12:50
@s1gr1d
s1gr1d requested a review from a team as a code owner October 7, 2026 12:50

@Lms24 Lms24 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

Comment on lines +11 to +15
/**
* Fallback for spans without a `previous_trace` link (e.g. from older SDKs). Format:
* `[traceId]-[spanId]-[sampledFlag]`. A malformed value disables the query or finds nothing.
*/
function parsePreviousTraceAttribute(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l: not fully sure if we need this. In JS We sent links even before we sent the attribute. But unless we want to minimize bundle size, it's fine to keep this around.

@s1gr1d s1gr1d Oct 9, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not a lot of lines but true, good catch. We can remove this so also no future SDKs are implementing based on this feature.

@s1gr1d

s1gr1d commented Oct 9, 2026

Copy link
Copy Markdown
Member Author

Since this PR was mentioned in PR #126894, I fixed this in beb27fe (this PR)

@s1gr1d
s1gr1d enabled auto-merge (squash) October 9, 2026 12:34
@s1gr1d
s1gr1d merged commit d8e65cb into master Oct 9, 2026
78 checks passed
@s1gr1d
s1gr1d deleted the sig/linked-traces-update branch October 9, 2026 12:54
s1gr1d added a commit to getsentry/sentry-javascript that referenced this pull request Oct 19, 2026

This branch was successfully deployed

1 active deployment
Preview — c3373da1 Deployed Oct 9, 2026 by vercel[bot]
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.

2 participants