Skip to content

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

Merged
JPeer264 merged 1 commit into
jp/cf-int-tests-http-server-streamingfrom
jp/cf-int-tests-request-handler-streaming
Sep 29, 2026
Merged

JPeer264 merged 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 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 29.24 kB - -
@sentry/browser - with treeshaking flags 27.5 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.4 kB - -
@sentry/browser (incl. Tracing) 51.15 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 51.18 kB - -
@sentry/browser (incl. Tracing, Profiling) 54.18 kB - -
@sentry/browser (incl. Tracing, Replay) 90.76 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 79.86 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 95.46 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 108.41 kB - -
@sentry/browser (incl. Feedback) 46.76 kB - -
@sentry/browser (incl. sendFeedback) 34.3 kB - -
@sentry/browser (incl. FeedbackAsync) 39.41 kB - -
@sentry/browser (incl. Metrics) 30.25 kB - -
@sentry/browser (incl. Logs) 30.51 kB - -
@sentry/browser (incl. Metrics & Logs) 31.18 kB - -
@sentry/react 31.08 kB - -
@sentry/react (incl. Tracing) 53.54 kB - -
@sentry/vue 36.74 kB - -
@sentry/vue (incl. Tracing) 53.7 kB - -
@sentry/svelte 29.26 kB - -
CDN Bundle 31.02 kB - -
CDN Bundle (incl. Tracing) 51.78 kB - -
CDN Bundle (incl. Logs, Metrics) 33.29 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 53.75 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 74 kB - -
CDN Bundle (incl. Tracing, Replay) 89.37 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 91.34 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 95.53 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 97.5 kB - -
CDN Bundle - uncompressed 91.66 kB - -
CDN Bundle (incl. Tracing) - uncompressed 154.05 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 98.23 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 160 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 227.8 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 273.78 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 279.72 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 287.48 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 293.41 kB - -
@sentry/nextjs (client) 55.78 kB - -
@sentry/sveltekit (client) 51.6 kB - -
@sentry/core/server 39.99 kB - -
@sentry/core/browser 13.63 kB - -
@sentry/node 141.92 kB +0.01% +12 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 82.88 kB - -
@sentry/node - without tracing 90.94 kB +0.02% +14 B 🔺
@sentry/node - without channel injection 120.3 kB +0.01% +8 B 🔺
@sentry/aws-serverless 99.17 kB +0.01% +4 B 🔺
@sentry/cloudflare (withSentry) - minified 206.64 kB - -
@sentry/cloudflare (withSentry) 514.04 kB - -

View base workflow run

@JPeer264
JPeer264 force-pushed the jp/cf-int-tests-request-handler-streaming branch from 876cda1 to a608671 Compare September 19, 2026 15:46
@JPeer264
JPeer264 marked this pull request as ready for review September 21, 2026 06:45
@JPeer264
JPeer264 requested a review from a team as a code owner September 21, 2026 06:45
@JPeer264
JPeer264 requested review from isaacs, msonnb and mydea and removed request for a team September 21, 2026 06:45
@github-actions

Copy link
Copy Markdown
Contributor

👋 @isaacs, @mydea, @msonnb — Please review this PR when you get a chance!

@JPeer264
JPeer264 force-pushed the jp/cf-int-tests-request-handler-streaming branch 2 times, most recently from dad4bdb to d3622f1 Compare September 27, 2026 13:28
@JPeer264
JPeer264 force-pushed the jp/cf-int-tests-request-handler-streaming branch from d3622f1 to b3dd1d6 Compare September 29, 2026 08:19
@github-actions

Copy link
Copy Markdown
Contributor

👋 @isaacs, @mydea, @msonnb — Please review this PR when you get a chance!

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 b3dd1d6 to be6b8fb Compare September 29, 2026 13:34
@JPeer264
JPeer264 merged commit d9cd3a0 into develop Sep 29, 2026
43 checks passed
@JPeer264
JPeer264 deleted the jp/cf-int-tests-request-handler-streaming branch September 29, 2026 13:53
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

2 participants