Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
11.1.0
Framework Version
Seen with Next.js 16 on the Vercel Node.js runtime. The cause is not specific to Next.js.
Link to Sentry event
No response
Reproduction Example/SDK Setup
Default server setup:
Sentry.init({
dsn: '...',
tracesSampleRate: 1,
});
Steps to Reproduce
- Deploy an app that uses the Node.js SDK to Vercel, on the Node.js runtime.
- Send one request.
- Send no more requests, so the function goes idle.
- Look for the request's telemetry in Sentry.
Expected Result
All telemetry of the request (spans, logs, metrics, errors) arrives shortly after the response.
Actual Result
Telemetry that was still buffered when the response was sent arrives late or never. It is sent only when a later request wakes the same instance. With span streaming, the root span of the last request is often missing and its child spans show up without a parent.
Additional Context
Vercel can suspend a function as soon as it sends the response. The SDK sends buffered telemetry on timers or on SIGTERM, and neither runs while the function is suspended.
Vercel provides waitUntil through Symbol.for('@vercel/request-context') on the Node.js runtime, but the SDK uses it only on the Edge runtime.
Fix: #24910. Related: #23087.
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
11.1.0
Framework Version
Seen with Next.js 16 on the Vercel Node.js runtime. The cause is not specific to Next.js.
Link to Sentry event
No response
Reproduction Example/SDK Setup
Default server setup:
Steps to Reproduce
Expected Result
All telemetry of the request (spans, logs, metrics, errors) arrives shortly after the response.
Actual Result
Telemetry that was still buffered when the response was sent arrives late or never. It is sent only when a later request wakes the same instance. With span streaming, the root span of the last request is often missing and its child spans show up without a parent.
Additional Context
Vercel can suspend a function as soon as it sends the response. The SDK sends buffered telemetry on timers or on
SIGTERM, and neither runs while the function is suspended.Vercel provides
waitUntilthroughSymbol.for('@vercel/request-context')on the Node.js runtime, but the SDK uses it only on the Edge runtime.Fix: #24910. Related: #23087.