Uh oh!
There was an error while loading. Please reload this page.
test(e2e): Group collectStreamedSpans by trace - #23912
Merged
Merged
Conversation
It accumulated every span envelope into a single array, so a test asserting on one request's children could mix in spans from an earlier page load's trace, or have its wait satisfied by them. Spans are bucketed per trace now and the predicate sees one trace at a time, so it resolves with a coherent set. Every trace is evaluated as a candidate, so a leftover trace that never satisfies the predicate cannot hold up the one that does. Note this scopes a result to a single trace, it does not identify which trace: when several tests exercise the same route, the predicate still has to name something unique to the request under test. Also re-exports `SerializedStreamedSpan`, which specs need to type their span helpers. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
size-limit report 📦
|
chargome
approved these changes
Sep 2, 2026
Uh oh!
There was an error while loading. Please reload this page.
JPeer264 added a commit
that referenced
this pull request
Sep 2, 2026
Ports `cloudflare-orchestrion-mysql` to span streaming. Streamed mysql spans are named by the low-cardinality query summary, which is `SELECT` for both statements in this app, so the spec locates the spans by their `db.query.text` attribute and pins the `SELECT` name separately. `collectStreamedSpans` groups spans by trace since #23912, so the predicate only has to see the `/test-mysql` segment and the `db` spans; the nested-query test keeps proving the async context restore by requiring both spans in that trace. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
JPeer264 added a commit
that referenced
this pull request
Sep 2, 2026
Ports `cloudflare-agent` to span streaming. The gen_ai assertions were already on streamed spans; the remaining `waitForTransaction` calls are replaced. - The worker and the Agent Durable Object both emit a `GET` segment for the same URL. The DO segment is picked by `url.path` plus a defined `parent_span_id` (the worker propagates its trace over the RPC binding), same discriminator the old spec used. - The three surviving storage spans are children of the `greet` rpc span, so they are selected by `parent_span_id` and ordered by `start_timestamp`; the count-based filter proof is unchanged. - gen_ai-to-segment relations rely on `collectStreamedSpans` grouping by trace (#23912): the collect finishes once the owning segment has arrived, so no manual `trace_id` matching is needed. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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 freeto 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.
What
Groups the spans
collectStreamedSpansaccumulates by trace, so its predicate sees one trace at a time instead of a flat pile, and it resolves with only that trace's spans. Also re-exportsSerializedStreamedSpanso specs can type their span helpers.Why
Spans are buffered per trace and flushed on a timer, so a previous test's spans can still be arriving when the next one starts collecting. A test asserting on one request's children could therefore mix in an earlier page load's spans, or have its wait satisfied by them before its own spans arrived. Every trace is evaluated as a candidate, so a leftover trace that never satisfies the predicate cannot hold up the one that does.
Note this scopes a result to a single trace, it does not identify which trace: when several tests exercise the same route, the predicate still has to name something unique to the request under test.
Split out of the React Router porting stack because it is useful on its own, and other span streaming ports can drop their hand-rolled
trace_idfiltering once it lands.