Title: @sentry/cloudflare: root http.server span lost on streaming responses exceeding ctx.waitUntil 30s budget (regression since 10.28.0) · Issue #20409 · getsentry/sentry-javascript · GitHub
Open Graph Title: @sentry/cloudflare: root http.server span lost on streaming responses exceeding ctx.waitUntil 30s budget (regression since 10.28.0) · Issue #20409 · getsentry/sentry-javascript
X Title: @sentry/cloudflare: root http.server span lost on streaming responses exceeding ctx.waitUntil 30s budget (regression since 10.28.0) · Issue #20409 · getsentry/sentry-javascript
Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using the latest SDK release https://github.com/...
Open Graph Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
X Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/20409
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"@sentry/cloudflare: root http.server span lost on streaming responses exceeding ctx.waitUntil 30s budget (regression since 10.28.0)","articleBody":"### Is there an existing issue for this?\n\n- [x] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\n- [x] I have reviewed the documentation https://docs.sentry.io/\n- [x] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\n\n### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### Which SDK are you using?\n\n@sentry/cloudflare\n\n### SDK Version\n\n10.28.0 through 10.49.0 (current develop). Regression introduced in 10.28.0, still present.\n\n### Framework Version\n\nN/A — reproducible directly against @sentry/cloudflare. Framework wrappers that route through wrapRequestHandler (e.g. @sentry/remix/cloudflare, @sentry/hono/cloudflare) are expected to be affected as well but not directly verified.\n\n### Link to Sentry event\n\n_No response_\n\n### Reproduction Example/SDK Setup\n\n```js\nimport * as Sentry from '@sentry/cloudflare';\n\nexport default Sentry.withSentry(\n (env) => ({ dsn: env.SENTRY_DSN, tracesSampleRate: 1.0 }),\n {\n async fetch(request, env, ctx) {\n // Any upstream producing a streaming body that takes >30s to fully emit\n // (e.g. LLM chat completion over SSE).\n const upstream = await fetch('https://example.com/long-sse-endpoint');\n return new Response(upstream.body, {\n headers: { 'content-type': 'text/event-stream' },\n });\n },\n },\n);\n```\n\n### Steps to Reproduce\n\n1. Deploy a Cloudflare Worker using `@sentry/cloudflare` ≥ 10.28.0 with `tracesSampleRate: 1.0`.\n2. Have the handler return a response whose `Content-Type` is classified as streaming by `classifyResponseStreaming()` — `text/event-stream`, `application/x-ndjson`, `application/stream+json`, or `text/plain` without `Content-Length`.\n3. Ensure the upstream response body takes longer than ~30 seconds to fully emit (the mechanism depends on upstream-body duration, not on whether the client disconnects).\n4. Observe span reporting for these requests.\n\n### Expected Result\n\nRoot `http.server` span is reported for every request, as on `@sentry/cloudflare` \u003c 10.28.0.\n\n### Actual Result\n\nRoot `http.server` span is silently dropped for requests whose upstream body duration exceeds the `ctx.waitUntil` 30s shared budget. Cloudflare emits the documented warning to Workers Logs:\n`waitUntil() tasks did not complete within the allowed time after invocation end and have been cancelled.`\n\nObservable signature when comparing pre-10.28 vs post-10.28 telemetry on the same streaming endpoint:\nPre-10.28: p95 span.duration reflects handler-return time (often single-digit seconds for endpoints that return a streaming body quickly).\nPost-10.28: p95 span.duration on landed spans sits just below the 30s waitUntil cap; requests whose upstream body takes longer than 30s never produce a span.\n\n### Additional Context\n\nI think this was introduced by:\n\n#18087 — fix(cloudflare): Keep http root span alive until streaming responses are consumed\n#18334 — fix(cloudflare): Wait for async events to finish\n\nBoth merged into 10.28.0.\n\n### Priority\n\n\u003csub>React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding `+1` or `me too`, to help us triage it.\u003c/sub>","author":{"url":"https://github.com/Kobby-Bawuah","@type":"Person","name":"Kobby-Bawuah"},"datePublished":"2026-04-21T03:44:08Z","url":"https://github.com/getsentry/sentry-javascript/issues/20409"}
| 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:9d686172-4097-a2f9-28ad-2fff76442053 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8284:1F35:AF84C6:F56892:6B043F48 |
| html-safe-nonce | dd2d795043262aed376a8a7d26ab923d35da6296ca4c68dc8a82682db1051c91 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Mjg0OjFGMzU6QUY4NEM2OkY1Njg5Mjo2QjA0M0Y0OCIsInZpc2l0b3JfaWQiOiIyNDk4OTE3MTExMTEyNjc5MjQwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a096801dd685789db77e51e49a489fc6201333db070e5c965a80eb277a056328 |
| hovercard-subject-tag | issue:4300123527 |
| 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/20409/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e85b1a67a7cf3ac0025e863a60cdd2b6ac1036824789ecb3b4a8bd064b92c8ff/getsentry/sentry-javascript/issues/20409 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e85b1a67a7cf3ac0025e863a60cdd2b6ac1036824789ecb3b4a8bd064b92c8ff/getsentry/sentry-javascript/issues/20409 |
| og:image:alt | Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Kobby-Bawuah |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9185ccfefd80c1ff2d9ddcdb0cd2becf46b5a1efbbf30741a895e4bb8de25e64 |
| 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 | 06dc448a76fe4751ac1db26524aefa3aa3e889a8 |
| 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