Skip to content

test(cloudflare): Port the request handler suites to span streaming - #24196

Draft
JPeer264 wants to merge 1 commit into
jp/cf-int-tests-http-server-streamingfrom
jp/cf-int-tests-request-handler-streaming
Draft

JPeer264 wants to merge 1 commit into
jp/cf-int-tests-http-server-streamingfrom
jp/cf-int-tests-request-handler-streaming

Conversation

@JPeer264

@JPeer264 JPeer264 commented Sep 8, 2026

Copy link
Copy Markdown
Member

Ports the remaining request handler suites off the traceLifecycle: 'static' pin: hono-sdk, double-instrumentation and public-api/metrics/server-address.

double-instrumentation and the metrics suite assert on an error event and on a metric envelope, so only the pin goes. double-instrumentation swaps its ignore('transaction') for ignore('span'), which is the envelope the http.server span now races the error event with.

The Hono routes are parametrized patterns, so their segment names survive streaming unchanged. What does change is the status: span v2 carries the coarse error on the span and the specific internal_error in the sentry.status.message attribute.

Static trace lifecycle guard

suites/basic keeps the static pin as the package's guard. It is the smallest suite that still covers a plain worker fetch, so it is the cheapest one to keep on the old lifecycle.

Suite left behind

suites/request-handler/subpath also stays pinned, but not by choice. With the pin removed, wrapRequestHandler from @sentry/cloudflare/request still sends a transaction envelope. That holds with traceLifecycle: 'stream' passed explicitly and with cacheClient: false, and the transaction's own sentry.sdk.integrations lists SpanStreaming — so the client the event is processed by does have streaming on, while getClient() inside _onSpanEnded does not see a streaming client and falls through to _convertSpanToTransaction. Every other entry point in the package streams, and they differ only in which default integration set they inject, so this looks like a gap in the /request entry rather than a test problem. It is tracked separately and the suite is left as it was.

Fixes #24148

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.09 kB - -
@sentry/browser - with treeshaking flags 27.35 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.26 kB - -
@sentry/browser (incl. Tracing) 50.56 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 50.58 kB - -
@sentry/browser (incl. Tracing, Profiling) 53.56 kB - -
@sentry/browser (incl. Tracing, Replay) 90.11 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 79.21 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 94.81 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 107.78 kB - -
@sentry/browser (incl. Feedback) 46.62 kB - -
@sentry/browser (incl. sendFeedback) 34.15 kB - -
@sentry/browser (incl. FeedbackAsync) 39.26 kB - -
@sentry/browser (incl. Metrics) 30.1 kB - -
@sentry/browser (incl. Logs) 30.35 kB - -
@sentry/browser (incl. Metrics & Logs) 31.02 kB - -
@sentry/react 30.84 kB - -
@sentry/react (incl. Tracing) 52.88 kB - -
@sentry/vue 36.34 kB - -
@sentry/vue (incl. Tracing) 52.86 kB - -
@sentry/svelte 29.11 kB - -
CDN Bundle 30.8 kB - -
CDN Bundle (incl. Tracing) 51.1 kB - -
CDN Bundle (incl. Logs, Metrics) 33.06 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 53.09 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.75 kB - -
CDN Bundle (incl. Tracing, Replay) 88.66 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 90.58 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 94.7 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 96.71 kB - -
CDN Bundle - uncompressed 91.16 kB - -
CDN Bundle (incl. Tracing) - uncompressed 152.53 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.73 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 158.49 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 227.14 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 272.1 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 278.04 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 285.81 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 291.74 kB - -
@sentry/nextjs (client) 55.21 kB - -
@sentry/sveltekit (client) 50.99 kB - -
@sentry/core/server 39.98 kB - -
@sentry/core/browser 13.66 kB - -
@sentry/node 133.34 kB +0.02% +25 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 82.17 kB - -
@sentry/node - without tracing 89.93 kB +0.03% +22 B 🔺
@sentry/node - without channel injection 112.15 kB +0.02% +14 B 🔺
@sentry/aws-serverless 98.19 kB +0.03% +21 B 🔺
@sentry/cloudflare (withSentry) - minified 204.69 kB - -
@sentry/cloudflare (withSentry) 509.25 kB - -

View base workflow run

Removes the `traceLifecycle: 'static'` pin from `suites/hono-sdk`,
`suites/double-instrumentation` and `suites/public-api/metrics/server-address`,
and rewrites the Hono transaction assertions to span v2.

`double-instrumentation` and the metrics suite assert on an error event and on a
metric envelope, so only the pin goes. `double-instrumentation` swaps its
`ignore('transaction')` for `ignore('span')`, which is the envelope the
`http.server` span now races the error event with.

The Hono routes are parametrized patterns, so their segment names survive
streaming unchanged. What does change is the status: span v2 carries the coarse
`error` on the span and the specific `internal_error` in the
`sentry.status.message` attribute.

`suites/basic` keeps the static pin as the package's guard for the static trace
lifecycle. It is the smallest suite that still covers a plain worker fetch.

`suites/request-handler/subpath` also stays pinned, but for a different reason:
`wrapRequestHandler` from `@sentry/cloudflare/request` still sends a transaction
envelope with the pin removed, even with `traceLifecycle: 'stream'` passed
explicitly and with `cacheClient: false`. The client it builds does carry the
`SpanStreaming` integration, so the span reaches the isolation scope's client but
`getClient()` in `_onSpanEnded` does not see a streaming client. That is an SDK
question rather than a test one, so the suite is left as it was and gets its own
issue.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@JPeer264
JPeer264 force-pushed the jp/cf-int-tests-request-handler-streaming branch from 876cda1 to a608671 Compare September 19, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cloudflare-integration-tests: port runtime binding suites to span streaming

1 participant