Title: bun, deno: `http.server` span ends before a streamed SSR response has been sent · Issue #25537 · getsentry/sentry-javascript · GitHub
Open Graph Title: bun, deno: `http.server` span ends before a streamed SSR response has been sent · Issue #25537 · getsentry/sentry-javascript
X Title: bun, deno: `http.server` span ends before a streamed SSR response has been sent · Issue #25537 · getsentry/sentry-javascript
Description: 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-Sen...
Open Graph Description: bunServerIntegration and denoServeIntegration end the http.server span when the handler returns, unless the shared classifier classifyResponseStreaming (@sentry/core/server) says that the response ...
X Description: bunServerIntegration and denoServeIntegration end the http.server span when the handler returns, unless the shared classifier classifyResponseStreaming (@sentry/core/server) says that the response ...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/25537
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"bun, deno: `http.server` span ends before a streamed SSR response has been sent","articleBody":"`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.\n\nSo 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, getsentry/sentry-javascript#24932 adds the `isStreamingResponse` option for this. Bun and Deno have no fix yet.\n\n## **Proposal**\n\n**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`.\n\n**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`.\n\n```ts\nSentry.init({\n dsn: process.env.SENTRY_DSN,\n integrations: [\n Sentry.bunServerIntegration({\n isStreamingResponse: response =>\n response.headers.get('content-type')?.startsWith('text/html') ? true : undefined,\n }),\n ],\n});\n","author":{"url":"https://github.com/JPeer264","@type":"Person","name":"JPeer264"},"datePublished":"2026-10-19T16:14:01Z","url":"https://github.com/getsentry/sentry-javascript/issues/25537"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0e975624-fe1f-424f-4aa8-9312a05efdb3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E6AA:28C0FE:230AA:2FDFE:6B0415EC |
| html-safe-nonce | df189854e1680c08594c34601ef7bf41339084e91da0901af5b9927b0fbdf45e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNkFBOjI4QzBGRToyMzBBQToyRkRGRTo2QjA0MTVFQyIsInZpc2l0b3JfaWQiOiI3OTQ2MDM4MTk0OTA1MjkwMjIwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 1927f9e2c2688f13045b6ee68eaf3b423e8c7b7beeaa7b2c561a4d670ebc6599 |
| hovercard-subject-tag | issue:5927396294 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/25537/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c115461fd98e06eea6f636620abe0794541f332566a39493888a807d3d4d64a4/getsentry/sentry-javascript/issues/25537 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c115461fd98e06eea6f636620abe0794541f332566a39493888a807d3d4d64a4/getsentry/sentry-javascript/issues/25537 |
| og:image:alt | bunServerIntegration and denoServeIntegration end the http.server span when the handler returns, unless the shared classifier classifyResponseStreaming (@sentry/core/server) says that the response ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JPeer264 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width