test(cloudflare): Port the vite-autoinstrument suites to span streaming - #24189
Draft
JPeer264 wants to merge 1 commit into
Draft
Conversation
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>
Contributor
size-limit report 📦
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports the seventeen
suites/vite-autoinstrumentsuites off thetraceLifecycle: 'static'pin.Under streaming a whole request chain is one trace, so each suite reads the trace with
collectStreamedSpansinstead of one envelope expectation per hop. Every hop here (a Durable Object, aWorkerEntrypoint, 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_putpair, now as children of its own segment span rather than asspansof its transaction. The chain is asserted directly, a hop's segment span carries the previous hop'sspan_idas itsparent_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 /greetbecomesGET, and the hop is identified through itsurl.pathattribute. That matters for the entrypoint and combination suites, where the transaction name used to tell the hops apart.The per-suite
expectDurableObjectTransaction,expectMainWorkerTransactionandexpectPlainTransactionhelpers 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