Repository navigation
fix(mcp): Keep N+1 evidence for performance issues detected from spans - #2468
Conversation
Span-detected performance issues are saved as generic events, so mapPerformance returned null for them and the detector evidence (transaction, parent span, repeat count, offending span IDs) was lost. Accept generic events whose occurrence is a performance issue type, and make selectN1EvidenceSpans fall back to the offending span IDs when the event has no spans entry and no trace was fetched. Fixes getsentry#2467 Co-Authored-By: Claude Code <noreply@anthropic.com>
|
@pcbeingused333 is attempting to deploy a commit to the Sentry Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
This PR has had no activity for 3 days. It closes in 2 days unless someone pushes, comments, or adds the |
|
Closed after 5 days with no activity. Reopen it to keep going. |
There was a problem hiding this comment.
Looks good to me. The premise holds against Sentry source: span-detected N+1 issues go through the issue platform and the occurrence consumer saves them as type: "generic", so the old event.type !== "transaction" guard in mapPerformance dropped their evidence. Gating generic events on a performance_* issue type keeps metric alerts and other generic occurrences out. The trace is already fetched for generic events, so the trace-based span tree still applies when it's available.
The selectN1EvidenceSpans change makes the function match its doc comment (fall back to the offending span IDs). It also changes transaction events with no spans entry and no matching trace spans from an empty list to offender stubs, which looks like the intended behavior.
Both new tests fail without the change and pass with it.
Fixes #2467
get_issue_detailsdropped the N+1 detector evidence for performance issues that Sentry detects from spans. Those issues are saved asgenericevents, andmapPerformancereturnednullunlessevent.type === "transaction", so the transaction, parent span, repeat count and offending span IDs never reached the response.Fix
mapPerformancealso acceptsgenericevents whose occurrence maps to aperformance_*issue type. Other generic occurrences (metric alerts, regressions) still leaveperformancenull.selectN1EvidenceSpansnow falls back to the offending span IDs when there is no trace data and nospansentry on the event, as its doc comment already describes. Before, it returned an empty list.Tests
issue-event-payload.test.ts: a generic event with a 1006 occurrence keeps issue type, transaction name, parent operation, repeat count and the offending spans; a generic 8001 occurrence keepsperformancenull.formatting.test.ts:selectN1EvidenceSpanswithout trace or spans returns the offending span IDs.Both new tests fail on main and pass with the change; the full mcp-core suite passes.
This pull request was prepared with AI assistance (Claude Code) and has not been reviewed line by line by a human.