You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[nextjs] Tunnel route requests are not dropped under the Next.request root span (Next.js 16.4.3+) #26093
Since Next.js 16.4.3, a proxy that runs separately from the render (for example on Vercel) gets a new Next.request root span. Middleware.execute becomes its child.
Our tunnel filter only looks at Middleware.execute and BaseServer.handleRequest spans. So for tunnel requests that go through the proxy, only the child span gets dropped. The Next.request root is still sent as a GET transaction (subject to the sample rate). This is noise, not a loop, because the server SDK sends straight to the DSN.
Affected code:
dropMiddlewareTunnelRequests() in packages/nextjs/src/common/utils/dropMiddlewareTunnelRequests.ts (the drop flag)
getTunnelRouteIgnoreSpans() in the same file (the ignoreSpans pattern used with span streaming)
vercel/next.js#100665 makes Middleware.execute the root again for requests the proxy answers itself. Requests that continue to a render keep the Next.request root, so we need the fix either way.
Related, possibly in the same PR: the Next.request root also gets the wrong name and op (GET middleware GET / http.server on Node, GET with no op on Edge). Before 16.4.3 these were middleware GET / http.server.middleware.
The nextjs-16-adapter e2e app from #26084 calls the proxy the way Vercel does, so it can cover this.
Activity
linear-code commentedon Nov 4, 2026
JS-4064