Skip to content

feat(seer): Return span links from the trace waterfall - #131057

Open
sentry-junior[bot] wants to merge 3 commits into
masterfrom
feat/seer-trace-waterfall-span-links
Open

sentry-junior[bot] wants to merge 3 commits into
masterfrom
feat/seer-trace-waterfall-span-links

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Seer can't see span links today. They live in the private sentry.links attribute, and the trace waterfall that Explorer and Code Mode (sentry.rpc.get_trace_waterfall) read doesn't select it.

This makes Seer's get_trace_waterfall select sentry.links and return each span's parsed links under links, in the same shape as the trace item details endpoint (serialize_link). The raw JSON is removed from additional_attributes. Spans without links are unchanged.

The motivating case is the cached-page work in getsentry/sentry-javascript#25318: a pageload served from a cached Next.js shell has no server spans, and its cache_origin link is the only path to the render that produced the HTML.

Spans.run_trace_query ignored the config it was given and always built a default one. It now uses the passed config, so query_trace_data can take an optional config and only the Seer waterfall allows the private attribute. Every other caller still passes the default, so the trace view and other endpoints are unaffected.

Cost: one extra column in the existing GetTraceRequest, which is empty for almost every span.

A Seer follow-up will render links in the trace tools.

Refs JSSDK-43

via Charly Gomez.

--

View Session [Sentry]

@sentry-junior
sentry-junior Bot requested review from a team as code owners November 13, 2026 09:57
@linear-code

linear-code Bot commented Nov 13, 2026

Copy link
Copy Markdown

JSSDK-43

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 13, 2026
@chargome
chargome marked this pull request as draft November 13, 2026 12:39
@chargome chargome self-assigned this Nov 13, 2026
sentry-junior Bot and others added 2 commits November 13, 2026 12:51
Seer's trace waterfall now selects the private sentry.links attribute and returns each span's parsed links under links, in the same shape as the trace item details endpoint. This lets Explorer and Code Mode follow links such as cache_origin from a cached Next.js pageload to the render that produced it. Spans.run_trace_query now uses the config it is given instead of a fresh default, so the waterfall can allow the private attribute without affecting other callers.

Refs JSSDK-43

Co-authored-by: Charly Gomez <20254395+chargome@users.noreply.github.com>
EAP returns an empty string for spans without sentry.links, which was parsed as JSON and logged a warning for every link-less span. Malformed link attributes also raised AttributeError and failed the whole waterfall. Add tests for both, and for the trace endpoint still rejecting the private attribute.

Refs JSSDK-43

Co-authored-by: Charly Gomez <20254395+chargome@users.noreply.github.com>
@sentry-junior
sentry-junior Bot force-pushed the feat/seer-trace-waterfall-span-links branch from ff30735 to 75e5fa5 Compare November 13, 2026 12:51
@chargome
chargome marked this pull request as ready for review November 13, 2026 12:56
@chargome
chargome requested a review from a team as a code owner November 13, 2026 12:56
@sentry-junior
sentry-junior Bot requested a review from chargome November 13, 2026 12:56
@chargome
chargome requested a review from s1gr1d November 13, 2026 12:56
@chargome

Copy link
Copy Markdown
Member

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 75e5fa5. Configure here.

Comment thread src/sentry/seer/agent/tools.py Resolved
Comment thread src/sentry/seer/agent/tools.py Resolved
Move JSON parsing for sentry.links into parse_links_json next to serialize_link, and use it from both serialize_links and the Seer trace waterfall. Each link is parsed on its own, so one malformed link no longer drops the valid ones.

Refs JSSDK-43

Co-authored-by: Charly Gomez <20254395+chargome@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants