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
bun, deno: http.server span ends before a streamed SSR response has been sent #25537
bunServerIntegration and denoServeIntegration end the http.server span when the handler returns, unless the shared classifier classifyResponseStreaming (@sentry/core/server) says that the response streams. The classifier knows Server-Sent Events, NDJSON, application/stream+json, and text/plain and text/x-component without a Content-Length. HTML does not count as streamed, because a buffered new Response(html) has no Content-Length either.
So for a streamed SSR page, the span ends too early. Spans created while the body streams, for example a Suspense render or a data fetch, end after their root span. On Cloudflare, #24932 adds the isStreamingResponse option for this. Bun and Deno have no fix yet.
Proposal
Deno: end the span on info.completed (Deno.ServeHandlerInfo) for every response, and return the handler's response unchanged. completed settles when the response has been sent or could not be sent. Then Deno needs no classifier and no option, and static bodies keep Deno's fast path and their Content-Length.
Bun:Bun.serve does not tell the handler when the response has been sent. Add isStreamingResponse(response, request) to bunServerIntegration, with the same contract as on Cloudflare: true keeps the span open until the body has been sent, false ends it at handler return, and any other value uses classifyResponseStreaming.
Activity
linear-code commentedon Oct 19, 2026
JS-3962