Skip to content

test(cloudflare): Port the binding suites to span streaming - #24190

Draft
JPeer264 wants to merge 1 commit into
jp/cf-int-tests-vite-autoinstrument-streamingfrom
jp/cf-int-tests-bindings-streaming
Draft

test(cloudflare): Port the binding suites to span streaming#24190
JPeer264 wants to merge 1 commit into
jp/cf-int-tests-vite-autoinstrument-streamingfrom
jp/cf-int-tests-bindings-streaming

Conversation

@JPeer264

@JPeer264 JPeer264 commented Sep 8, 2026

Copy link
Copy Markdown
Member

Ports the binding suites off the traceLifecycle: 'static' pin: d1, r2, queue, prisma, durableobject/error, workflows/step-context and vite/diagnostics-channel/vercelai-6.

durableobject/error and workflows/step-context only assert on error events, so the pin is all that goes. cache-client and durableobject-scope were already unpinned and keep ignoring spans, so they are untouched.

Most binding spans keep the shape they had and only the encoding changes, so the r2 and queue suites keep one envelope expectation per request. Two things do change.

D1 and Prisma spans carry the db.query op, so streaming names them after db.query.summary: SELECT * FROM users WHERE id = ? becomes SELECT users. The Prisma suite loses the description-based split between its two SELECT spans, which now share the name SELECT main.User. The D1 one is picked by its op instead, and the traceparent comment that used to be matched on the description is asserted on db.query.text.

prisma and vercelai-6 switch to collectStreamedSpansUntilSegment. Both assert on the complete child set of one request and the span buffer flushes on a timer, so reading a single envelope would be a race. vercelai-6 also drops the separate span container it used to read next to the transaction item: a streamed gen_ai span is an ordinary item of the one span envelope.

/ keeps its GET / name under streaming (the source is route, not url), so vercelai-6 waits on that rather than the bare method the raw-URL suites see.

Part of #24148

🤖 Generated with Claude Code

Removes the `traceLifecycle: 'static'` pin from `suites/d1`, `suites/r2`,
`suites/queue`, `suites/prisma`, `suites/durableobject/error`,
`suites/workflows/step-context` and `suites/vite/diagnostics-channel/vercelai-6`,
and rewrites the assertions from transaction envelopes to span v2.

`durableobject/error` and `workflows/step-context` only assert on error events,
so the pin is all that goes. `cache-client` and `durableobject-scope` were
already unpinned; they drop `transaction` from their ignore list, which is now an
envelope type nothing emits.

The binding spans keep the shape they had, and only the encoding changes: a span
carries its name in `name` rather than `description`, its op and origin as
attributes, and every attribute as a `{ type, value }` pair. The r2 and queue
suites therefore keep one envelope expectation per request.

Two things do change.

D1 and Prisma spans are `db.query`, so streaming names them after
`db.query.summary`. `SELECT * FROM users WHERE id = ?` becomes `SELECT users`.
The Prisma suite loses the description-based split between its two `SELECT`
spans, which now share the name `SELECT main.User`, so the D1 one is picked by its
op and the traceparent comment is asserted on `db.query.text` instead.

`prisma` and `vercelai-6` collect until the whole trace is in hand, seventeen spans
and three. Both assert on the complete child set of one request, and the span
buffer flushes on a timer, so reading a single envelope would be a race. Waiting
for the segment span would be one too: it ends last, but each envelope is its own
request to the mock server, so it can arrive before its children do.

`vercelai-6` also drops the separate span container it used to read next to the
transaction item: a streamed gen_ai span is an ordinary item of the one span
envelope.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.8 kB added added
@sentry/browser - with treeshaking flags 27.11 kB added added
@sentry/browser - with treeshaking flags tracing without tracing 27 kB added added
@sentry/browser (incl. Tracing) 49.22 kB added added
@sentry/browser (incl. Tracing + Span Streaming) 49.22 kB added added
@sentry/browser (incl. Tracing, Profiling) 52.12 kB added added
@sentry/browser (incl. Tracing, Replay) 88.76 kB added added
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.95 kB added added
@sentry/browser (incl. Tracing, Replay with Canvas) 93.44 kB added added
@sentry/browser (incl. Tracing, Replay, Feedback) 106.37 kB added added
@sentry/browser (incl. Feedback) 46.3 kB added added
@sentry/browser (incl. sendFeedback) 33.86 kB added added
@sentry/browser (incl. FeedbackAsync) 38.97 kB added added
@sentry/browser (incl. Metrics) 29.82 kB added added
@sentry/browser (incl. Logs) 30.09 kB added added
@sentry/browser (incl. Metrics & Logs) 30.75 kB added added
@sentry/react 30.55 kB added added
@sentry/react (incl. Tracing) 51.42 kB added added
@sentry/vue 36.05 kB added added
@sentry/vue (incl. Tracing) 51.48 kB added added
@sentry/svelte 28.83 kB added added
CDN Bundle 30.55 kB added added
CDN Bundle (incl. Tracing) 49.74 kB added added
CDN Bundle (incl. Logs, Metrics) 32.82 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) 51.7 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) 73.48 kB added added
CDN Bundle (incl. Tracing, Replay) 87.29 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 89.18 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) 93.22 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 95.21 kB added added
CDN Bundle - uncompressed 90.46 kB added added
CDN Bundle (incl. Tracing) - uncompressed 148.17 kB added added
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.03 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 154.14 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 226.29 kB added added
CDN Bundle (incl. Tracing, Replay) - uncompressed 267.76 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 273.71 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 281.46 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 287.4 kB added added
@sentry/nextjs (client) 54.03 kB added added
@sentry/sveltekit (client) 49.65 kB added added
@sentry/core/server 38.62 kB added added
@sentry/core/browser 13.55 kB added added
@sentry/node 124.93 kB added added
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.51 kB added added
@sentry/node - without tracing 88.64 kB added added
@sentry/node - without channel injection 104.25 kB added added
@sentry/aws-serverless 97.02 kB added added
@sentry/cloudflare (withSentry) - minified 201.91 kB added added
@sentry/cloudflare (withSentry) 502.4 kB added added

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.

1 participant