Skip to content

feat(v10/nextjs): Add a tunnel route handler that sends only the event payload to Sentry - #25559

Merged
s1gr1d merged 1 commit into
v10from
sig/v10-nextjs-tunnel-route-handler
Oct 20, 2026
Merged

s1gr1d merged 1 commit into
v10from
sig/v10-nextjs-tunnel-route-handler

Conversation

@s1gr1d

@s1gr1d s1gr1d commented Oct 20, 2026

Copy link
Copy Markdown
Member

Backport of: #25456

Differences to the original PR

  • src/server/index.ts, src/edge/index.ts: adds getTunnelRouteIgnoreSpans() to the local nextjsIgnoreSpans arrays, because v10 has no NEXTJS_SERVER_IGNORE_SPANS.
  • src/config/withSentryConfig/getFinalConfigObjectUtils.ts: logs with console.log / console.warn and skips the output with silent, because v10 has no getBuildLogger (fix(nextjs): Apply silent to the SDK's own build logs #23621).
  • src/common/utils/dropMiddlewareTunnelRequests.ts, src/common/utils/tunnelPathnameMatch.ts: keeps the v10 code (isSentryRequestSpan, isSentryTunnelRequest) and adds only the new functions. The middleware skip of v10 does not change: in handler mode the client posts to the bare path, so the skip does not apply and the user's middleware runs, as on v11.
  • src/common/wrapMiddlewareWithSentry.ts (v10 only): on Next.js 13, the wrapper starts the middleware span itself, and the span has no request target, so the new ignoreSpans entries cannot match it. In handler mode, the wrapper now sets sentry.drop_transaction on this span for tunnel requests. The middleware still runs.
  • src/config/types.ts: the middleware paragraph starts with "With this handler", because in rewrite mode v10 still skips the middleware for tunnel requests.
  • E2E nextjs-16-tunnel: the handler test without server spans checks transactions, because v10 uses the static lifecycle by default. @sentry/conventions is 0.16.0, the version of v10. Playwright and @sentry-internal/test-utils keep the v10 versions.
  • CHANGELOG.md: the entry is under "Unreleased", with one more sentence about middleware.

@s1gr1d
s1gr1d marked this pull request as ready for review October 20, 2026 13:51
@s1gr1d
s1gr1d requested a review from a team as a code owner October 20, 2026 13:51
@s1gr1d
s1gr1d requested review from chargome, logaretm and nicohrubec and removed request for a team October 20, 2026 13:51
@s1gr1d
s1gr1d added this pull request to stack #25563 October 20, 2026 13:51
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.21 kB added added
@sentry/browser - with treeshaking flags 26.66 kB added added
@sentry/browser (incl. Tracing) 47.23 kB added added
@sentry/browser (incl. Tracing + Span Streaming) 49.03 kB added added
@sentry/browser (incl. Tracing, Profiling) 52.02 kB added added
@sentry/browser (incl. Tracing, Replay) 86.64 kB added added
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 76.27 kB added added
@sentry/browser (incl. Tracing, Replay with Canvas) 91.35 kB added added
@sentry/browser (incl. Tracing, Replay, Feedback) 103.97 kB added added
@sentry/browser (incl. Feedback) 45.38 kB added added
@sentry/browser (incl. sendFeedback) 33.01 kB added added
@sentry/browser (incl. FeedbackAsync) 38.14 kB added added
@sentry/browser (incl. Metrics) 29.31 kB added added
@sentry/browser (incl. Logs) 29.55 kB added added
@sentry/browser (incl. Metrics & Logs) 30.22 kB added added
@sentry/react 30.02 kB added added
@sentry/react (incl. Tracing) 49.53 kB added added
@sentry/vue 34.1 kB added added
@sentry/vue (incl. Tracing) 49.61 kB added added
@sentry/svelte 28.24 kB added added
CDN Bundle 30.62 kB added added
CDN Bundle (incl. Tracing) 49.18 kB added added
CDN Bundle (incl. Logs, Metrics) 32.19 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) 50.49 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) 71.62 kB added added
CDN Bundle (incl. Tracing, Replay) 86.87 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.16 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) 92.68 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 93.97 kB added added
CDN Bundle - uncompressed 91 kB added added
CDN Bundle (incl. Tracing) - uncompressed 148.26 kB added added
CDN Bundle (incl. Logs, Metrics) - uncompressed 95.71 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.24 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 221.06 kB added added
CDN Bundle (incl. Tracing, Replay) - uncompressed 268.08 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 272.05 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 281.78 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 285.74 kB added added
@sentry/nextjs (client) 52.14 kB added added
@sentry/sveltekit (client) 47.66 kB added added
@sentry/core/server 81.62 kB added added
@sentry/core/browser 67.67 kB added added
@sentry/node-core 64.04 kB added added
@sentry/node 127.22 kB added added
@sentry/node (incl. diagnostics channel injection) 171.41 kB added added
@sentry/node/import (ESM hook with diagnostics-channel injection) 166 B added added
@sentry/node/light 52.09 kB added added
@sentry/node - without tracing 75.82 kB added added
@sentry/aws-serverless 84.99 kB added added
@sentry/cloudflare (withSentry) - minified 204.93 kB added added
@sentry/cloudflare (withSentry) 505.2 kB added added

@s1gr1d
s1gr1d merged commit f75ba92 into v10 Oct 20, 2026
163 of 165 checks passed
@s1gr1d
s1gr1d deleted the sig/v10-nextjs-tunnel-route-handler branch October 20, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants