Skip to content

feat(seer): Add structured LLM context for trace details page#114093

Merged
Mihir-Mavalankar merged 4 commits intomasterfrom
mihir/trace-details-llm-context
Apr 28, 2026
Merged

feat(seer): Add structured LLM context for trace details page#114093
Mihir-Mavalankar merged 4 commits intomasterfrom
mihir/trace-details-llm-context

Conversation

@Mihir-Mavalankar
Copy link
Copy Markdown
Contributor

@Mihir-Mavalankar Mihir-Mavalankar commented Apr 27, 2026

  • Register the trace details page with the LLM context system so the Seer Explorer agent receives a structured JSON summary instead of an ASCII DOM snapshot. Pushes trace metadata (shape, duration, web vitals, error/span counts, top-level transactions) and tool-call hints for deeper investigation.

  • The idea here is to give the agent the minimal amount of information to make the right tool calls.

  • Behind the context-engine-structured-page-context feature flag on the /explore/traces/trace/:traceSlug/ route. Currenlty only enabled for me and Shruthi.

Register the trace details page with the LLM context system so the
Seer Explorer agent receives a structured JSON summary instead of an
ASCII DOM snapshot. Pushes trace metadata (shape, duration, web vitals,
error/span counts, top-level transactions) and tool-call hints for
deeper investigation.

Behind the context-engine-structured-page-context feature flag on
the /explore/traces/trace/:traceSlug/ route.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Mihir-Mavalankar Mihir-Mavalankar self-assigned this Apr 27, 2026
@Mihir-Mavalankar Mihir-Mavalankar requested review from a team as code owners April 27, 2026 21:38
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 27, 2026
@Mihir-Mavalankar Mihir-Mavalankar marked this pull request as draft April 27, 2026 22:08
The agent can fetch the full waterfall via get_trace_waterfall, so
top-level nodes were redundant. Replace with focusedSpan which surfaces
the span currently selected in the drawer — the unique context only
the on-page state can provide.

The hint notes the focused span may or may not be relevant to the
user's question since they may have clicked it incidentally.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment thread static/app/views/performance/newTraceDetails/index.tsx Outdated
Comment thread static/app/views/performance/newTraceDetails/index.tsx Outdated
Comment thread static/app/views/performance/newTraceDetails/index.tsx Outdated
Comment thread static/app/views/performance/newTraceDetails/index.tsx Outdated
Comment thread static/app/views/performance/newTraceDetails/index.tsx Outdated
Comment thread static/app/views/performance/newTraceDetails/index.tsx Outdated
Remove traceType and shape from context data — these are frontend
implementation details the agent doesn't need. Rename the wrapped
component so the call site stays as TraceViewImpl, keeping the LLM
context wiring as an invisible implementation detail.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Drop focusedSpan — the clicked span is unreliable signal for user
intent. A better pattern would be an explicit UX like right-click →
"Explain with Seer". Rename projects to services for clarity. Remove
the .slice(0, 10) cap to avoid silently truncating data that could
mislead the LLM.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Mihir-Mavalankar Mihir-Mavalankar merged commit 8f53118 into master Apr 28, 2026
64 of 65 checks passed
@Mihir-Mavalankar Mihir-Mavalankar deleted the mihir/trace-details-llm-context branch April 28, 2026 17:03
Mihir-Mavalankar added a commit that referenced this pull request May 1, 2026
+ Replace the ASCII DOM snapshot with structured semantic context on the
/issues/ page for the Seer Explorer agent. Registers an 'issue-list'
node type that pushes query filters, sort order, issue count, page
filters, and a compact pipe-delimited CSV of the 25 visible issues
(shortId, title, type, level, priority, events, users, firstSeen) into
the LLM context tree.
+ Current p50 for this page is [5700
tokens](https://redash.getsentry.net/queries/10910). I am estimating
this will bring it down to ~1200.
+ Gated behind the context-engine-structured-page-context flag via
NEW_STRUCTURED_CONTEXT_ROUTES. ONly open to 4 internal users.
+ Similar work on other pages: 
+ Trace details page -#114093
+ Traces explore page - #114347
    + Dashboard page - #111973
+ Shipped post:
https://vanguard.getsentry.net/p/cmodhfvfr00033pvr5owrfnke

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
cleptric pushed a commit that referenced this pull request May 5, 2026
+ Register the trace details page with the LLM context system so the
Seer Explorer agent receives a structured JSON summary instead of an
ASCII DOM snapshot. Pushes trace metadata (shape, duration, web vitals,
error/span counts, top-level transactions) and tool-call hints for
deeper investigation.

+ The idea here is to give the agent the minimal amount of information
to make the right tool calls.

+ Behind the context-engine-structured-page-context feature flag on the
/explore/traces/trace/:traceSlug/ route. Currenlty only enabled for me
and Shruthi.

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
cleptric pushed a commit that referenced this pull request May 5, 2026
+ Replace the ASCII DOM snapshot with structured semantic context on the
/issues/ page for the Seer Explorer agent. Registers an 'issue-list'
node type that pushes query filters, sort order, issue count, page
filters, and a compact pipe-delimited CSV of the 25 visible issues
(shortId, title, type, level, priority, events, users, firstSeen) into
the LLM context tree.
+ Current p50 for this page is [5700
tokens](https://redash.getsentry.net/queries/10910). I am estimating
this will bring it down to ~1200.
+ Gated behind the context-engine-structured-page-context flag via
NEW_STRUCTURED_CONTEXT_ROUTES. ONly open to 4 internal users.
+ Similar work on other pages: 
+ Trace details page -#114093
+ Traces explore page - #114347
    + Dashboard page - #111973
+ Shipped post:
https://vanguard.getsentry.net/p/cmodhfvfr00033pvr5owrfnke

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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