Skip to content

Telemetry is delayed or lost when Vercel suspends a Node.js function after the response #24909

Description

@sergical

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

  1. Deploy an app that uses the Node.js SDK to Vercel, on the Node.js runtime.
  2. Send one request.
  3. Send no more requests, so the function goes idle.
  4. 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.

Activity

  1. linear-code commented on Sep 30, 2026

    @linear-code
  2. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Sep 30, 2026
  3. Lms24 commented on Oct 1, 2026

    @Lms24
    Member

    Wondering if this just concerns span streaming or also logs, metrics or anything else that doesn't send immediately. Or IOW where we should actually make that flush call.

  4. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Oct 1, 2026
  5. added a commit that references this issue on Oct 1, 2026
    50ac024
  6. changed the title [-]Span streaming drops the root span on Vercel Node.js runtime (Fluid compute)[/-] [+]Telemetry is delayed or lost when Vercel suspends a Node.js function after the response[/+] on Oct 1, 2026
  7. sergical commented on Oct 1, 2026

    @sergical
    MemberAuthor

    @Lms24 thank you for encouraging to look at it holistically, updated the context, let me know if anything is unclear

  8. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Oct 2, 2026
  9. Lms24 commented on Oct 2, 2026

    @Lms24
    Member

    thx, left a quick review but need more eyes on the fix. Nice idea with the diagnostic channel!

  10. added a commit that references this issue on Oct 6, 2026
    161bd94
  11. github-actions commented on Oct 7, 2026

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #24910, which was included in the 11.5.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions