feat(seer): Add structured LLM context for trace details page#114093
Merged
Mihir-Mavalankar merged 4 commits intomasterfrom Apr 28, 2026
Merged
feat(seer): Add structured LLM context for trace details page#114093Mihir-Mavalankar merged 4 commits intomasterfrom
Mihir-Mavalankar merged 4 commits intomasterfrom
Conversation
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>
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>
JonasBa
approved these changes
Apr 27, 2026
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>
JonasBa
approved these changes
Apr 28, 2026
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>
3 tasks
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.