Skip to content

fix(mcp): Keep N+1 evidence for performance issues detected from spans - #2468

Open
pcbeingused333 wants to merge 1 commit into
getsentry:mainfrom
pcbeingused333:fix/n1-generic-evidence
Open

pcbeingused333 wants to merge 1 commit into
getsentry:mainfrom
pcbeingused333:fix/n1-generic-evidence

Conversation

@pcbeingused333

Copy link
Copy Markdown
Contributor

Fixes #2467

get_issue_details dropped the N+1 detector evidence for performance issues that Sentry detects from spans. Those issues are saved as generic events, and mapPerformance returned null unless event.type === "transaction", so the transaction, parent span, repeat count and offending span IDs never reached the response.

Fix

  • mapPerformance also accepts generic events whose occurrence maps to a performance_* issue type. Other generic occurrences (metric alerts, regressions) still leave performance null.
  • selectN1EvidenceSpans now falls back to the offending span IDs when there is no trace data and no spans entry 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 keeps performance null.
  • formatting.test.ts: selectN1EvidenceSpans without 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.

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
pcbeingused333 requested a review from a team as a code owner November 23, 2026 05:01
@vercel

vercel Bot commented Nov 23, 2026

Copy link
Copy Markdown

@pcbeingused333 is attempting to deploy a commit to the Sentry Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
vercel Bot temporarily deployed to Preview – sentry-local November 23, 2026 05:01 Inactive
@vercel

vercel Bot commented Nov 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Nov 23, 2026 5:01am UTC

Request Review

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 23, 2026

This branch was previously deployed

1 inactive deployment
Preview – sentry-local — 364e5e8c Deployed Nov 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue details drop N+1 evidence for performance issues detected from spans (generic events)

1 participant