Skip to content

test(cloudflare): Port the vite-autoinstrument suites to span streaming - #24189

Merged
JPeer264 merged 1 commit into
jp/cf-int-tests-propagation-streamingfrom
jp/cf-int-tests-vite-autoinstrument-streaming
Sep 29, 2026
Merged

JPeer264 merged 1 commit into
jp/cf-int-tests-propagation-streamingfrom
jp/cf-int-tests-vite-autoinstrument-streaming

Conversation

@JPeer264

@JPeer264 JPeer264 commented Sep 8, 2026

Copy link
Copy Markdown
Member

Ports the seventeen suites/vite-autoinstrument suites off the traceLifecycle: 'static' pin.

Under streaming a whole request chain is one trace, so each suite reads the trace with collectStreamedSpans instead of one envelope expectation per hop. Every hop here (a Durable Object, a WorkerEntrypoint, a Workflow step) runs in its own isolate and streams its own envelope, so a single-envelope read would be a race.

The proof of instrumentation is unchanged, only its shape is: a Durable Object still shows the durable_object_storage_get / durable_object_storage_put pair, now as children of its own segment span rather than as spans of its transaction. The chain is asserted directly, a hop's segment span carries the previous hop's span_id as its parent_span_id, which is stronger than the disjointness the old unordered expectations relied on.

Every route in these suites is a raw URL, so the streamed segment name keeps the method only. GET /greet becomes GET, and the hop is identified through its url.path attribute. That matters for the entrypoint and combination suites, where the transaction name used to tell the hops apart.

The per-suite expectDurableObjectTransaction, expectMainWorkerTransaction and expectPlainTransaction helpers are gone. The assertions are inlined, and the suites that hit two endpoints loop over the two paths.

Part of #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-vite-autoinstrument-streaming branch from 6745f12 to 6d07153 Compare September 19, 2026 15:46
@JPeer264 JPeer264 self-assigned this Sep 21, 2026
@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 andreiborza, isaacs and msonnb and removed request for a team September 21, 2026 06:45
@github-actions

Copy link
Copy Markdown
Contributor

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

@JPeer264
JPeer264 force-pushed the jp/cf-int-tests-vite-autoinstrument-streaming branch from 6d07153 to fa81bd1 Compare September 27, 2026 09:54
@JPeer264
JPeer264 force-pushed the jp/cf-int-tests-vite-autoinstrument-streaming branch from fa81bd1 to 564dc8f Compare September 27, 2026 13:28
@JPeer264
JPeer264 force-pushed the jp/cf-int-tests-vite-autoinstrument-streaming branch from 564dc8f to 32e3084 Compare September 29, 2026 08:19
@github-actions

Copy link
Copy Markdown
Contributor

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

Removes the `traceLifecycle: 'static'` pin from the seventeen
`suites/vite-autoinstrument` suites, and rewrites the assertions from
transaction envelopes to span v2.

Under streaming a whole request chain is one trace, so a suite reads the trace
rather than one envelope per hop. Every suite now uses `collectStreamedSpans`,
because each hop, a Durable Object, a `WorkerEntrypoint` or a Workflow step,
runs in its own isolate and streams its own envelope.

The proof of instrumentation is unchanged, only its shape is. A Durable Object
still shows the `durable_object_storage_get` and `durable_object_storage_put`
pair, but as children of its own segment span rather than as `spans` of its
transaction. The chain is now asserted directly: a hop's segment span carries
the previous hop's `span_id` as its `parent_span_id`.

Every route in these suites is a raw URL, so the streamed segment name keeps the
method only. `GET /greet` becomes `GET`, and the hop is identified by its
`url.path` attribute. That matters for the entrypoint and combination suites,
where the segment name used to tell the hops apart.

The per-suite `expectDurableObjectTransaction`, `expectMainWorkerTransaction`
and `expectPlainTransaction` helpers are gone. The assertions are inlined, and
the suites that hit two endpoints loop over the two paths instead.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@JPeer264
JPeer264 force-pushed the jp/cf-int-tests-vite-autoinstrument-streaming branch from 32e3084 to da8c458 Compare September 29, 2026 13:34
@JPeer264
JPeer264 merged commit ce8aead into develop Sep 29, 2026
43 checks passed
@JPeer264
JPeer264 deleted the jp/cf-int-tests-vite-autoinstrument-streaming branch September 29, 2026 13:52
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.

2 participants