Repository navigation
Conversation
…roxy Requests behind the proxy produce an extra route-less `GET` segment with op `http.server` next to the route segment. This test shows it for an API route and a page. Refs #25370 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Since Next.js 16.3 the proxy span is no longer a child of the `BaseServer.handleRequest` span that runs it, so that span became an empty `http.server` segment next to the one of the route. Drop it at span start in `beforeSampling`, based on the `middlewareInvoke` flag Next.js sets on the request. Its attributes at start are the same as the route's. For this, core now keeps the incoming request on the request's isolation scope and enforces the `beforeSampling` decision again, which it had stopped doing when `SentrySampler` was removed. Fixes #25370 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit bcb8427. Configure here.
| expect(segmentSpans.map(span => span.name).sort()).toEqual([`GET ${path}`, 'middleware GET']); | ||
| expect(segmentSpans.filter(span => getSpanOp(span) === 'http.server').map(span => span.name)).toEqual([ | ||
| `GET ${path}`, | ||
| ]); |
There was a problem hiding this comment.
Span op asserted as string literal
Low Severity
The new segment assertion compares getSpanOp to the string 'http.server'. Testing conventions require span-op assertions to use the @sentry/conventions constant rather than a literal. Flagged because it is called out in the PR review rules.
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit bcb8427. Configure here.
| `GET ${path}`, | ||
| ]); | ||
| }); | ||
| } |
There was a problem hiding this comment.
Loop registers scenarios instead of test.each
Low Severity
A for loop registers the same proxy-segment test for two paths. Testing conventions call for test.each when one case covers multiple scenarios, instead of generating tests in a loop. Flagged because it is called out in the PR review rules.
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit bcb8427. Configure here.
size-limit report 📦
|


Behind a proxy, Next.js runs each request through two
handleRequestcalls: one only runs the proxy, the other renders the route. Since Next.js 16.3 the proxy span is no longer a child of the first call's span, so that span became an emptyGETsegment with ophttp.server, counted next to the real one. We now drop it at span start, using themiddlewareInvokeflag Next.js sets on the request. At start, its attributes are the same as the real span's.For this, core keeps the incoming request on the request's isolation scope, and enforces the
beforeSamplingdecision again. It stopped doing that whenSentrySamplerwas removed, which also silently disabled the existing Next.js drop of Sentry ingest requests.Fixes #25370
🤖 Generated with Claude Code