Repository navigation
Commit eed2240
feat: add trace/span/log hints to issue details response (#987)
## Summary
When the MCP tool returns issue details, the "Using this information"
section now includes contextual hints for inspecting traces, spans, and
logs — but only when the event has a `trace_id` in its context.
### What changed
In `formatIssueOutput` (formatting.ts), three new bullets are added when
`event.contexts.trace.trace_id` exists:
- **Trace tree**: `get_sentry_resource(resourceType='trace', ...)` —
inspect the full distributed trace and span tree
- **Search spans**: `search_events(dataset='spans',
query='trace:<traceId>')` — find related spans
- **Search logs**: `search_events(dataset='logs',
query='trace:<traceId>')` — find related logs
Each hint uses the correct parameter names and explicit `dataset`
values, matching the pattern in `get-trace-details.ts`.
### Why
As noted by @AniketDhilip — the issue details response already tells the
LLM how to search for other error events (`search_issue_events`), but
doesn't mention how to explore traces, spans, or logs. This is a gap
since those are often the most useful next steps for debugging.
### Design choices
- **Contextual**: hints only appear when a trace_id exists, so responses
for events without traces stay compact
- **Minimal**: three bullets, using existing tools
(`get_sentry_resource` and `search_events`) with correct param names and
explicit datasets
- **Non-breaking**: breadcrumbs hint remains gated behind
`experimentalMode` as before
- All existing tests pass with updated snapshot expectations
---------
Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Junior <junior@sentry.io>1 parent e31c851 commit eed2240
2 files changed
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1927 | 1927 | | |
1928 | 1928 | | |
1929 | 1929 | | |
| 1930 | + | |
| 1931 | + | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
1930 | 1936 | | |
1931 | 1937 | | |
1932 | 1938 | | |
1933 | 1939 | | |
1934 | 1940 | | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
| 1944 | + | |
| 1945 | + | |
1935 | 1946 | | |
1936 | 1947 | | |
1937 | 1948 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
261 | 264 | | |
262 | 265 | | |
263 | 266 | | |
| |||
514 | 517 | | |
515 | 518 | | |
516 | 519 | | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
517 | 523 | | |
518 | 524 | | |
519 | 525 | | |
| |||
796 | 802 | | |
797 | 803 | | |
798 | 804 | | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
799 | 808 | | |
800 | 809 | | |
801 | 810 | | |
| |||
0 commit comments