test(cloudflare): Port the tracing suites to span streaming - #24179
Draft
JPeer264 wants to merge 1 commit into
Draft
test(cloudflare): Port the tracing suites to span streaming#24179JPeer264 wants to merge 1 commit into
JPeer264 wants to merge 1 commit into
Conversation
Contributor
size-limit report 📦
|
JPeer264
force-pushed
the
jp/cf-int-tests-tracing-streaming
branch
from
September 7, 2026 14:41
141f36a to
8d1812d
Compare
JPeer264
force-pushed
the
jp/cf-int-tests-tracing-streaming
branch
from
September 7, 2026 15:19
8d1812d to
84b3d56
Compare
JPeer264
force-pushed
the
jp/cf-int-tests-tracing-streaming
branch
2 times, most recently
from
September 7, 2026 15:49
ac2aec2 to
2f07f77
Compare
Removes the `traceLifecycle: 'static'` pin from the `suites/tracing` suites, and
rewrites the assertions from transaction envelopes to span v2. The
`tracing/propagation` suites follow in a separate PR. `tracing/d1` also loses its
env-gated `STREAMED` switch and the static copy of its test, so one test now
covers the streamed behaviour.
Most suites keep the shape they had, and only the assertions change: a span
carries its name in `name` rather than `description`, its op and origin as
attributes rather than fields, and every attribute as a `{ type, value }` pair.
The gen_ai suites keep asserting the complete attribute set, so an unexpected
attribute still fails the test. Streaming adds six attributes to every span:
`sentry.trace_lifecycle`, `sentry.segment.name`, `sentry.segment.id`,
`sentry.sdk.name`, `sentry.sdk.version` and `sentry.environment`.
The runs surfaced three behaviours that shape the rewrite.
A `url` source segment span keeps the method only. `GET /error` becomes `GET`,
so those suites assert `GET` and read the route from the `url.path` attribute.
The segment span can arrive in a later envelope than its children, because it
ends last. `opentelemetry-tracer/internal-request-handler` failed on that, and
now uses `collectStreamedSpansUntilSegment`.
Start timestamps tie at millisecond resolution in workerd, so an order-based
assertion over child spans is unreliable. `opentelemetry-tracer/enabled` matches
spans by name instead.
`instrument-fetcher` uses `collectStreamedSpans`, because the worker and the
Durable Object stream their segment spans from separate isolates. The Durable
Object storage suites keep a single envelope expectation, because their spans do
arrive together.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
JPeer264
force-pushed
the
jp/cf-int-tests-tracing-streaming
branch
from
September 7, 2026 16:00
2f07f77 to
977b1ac
Compare
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.
This PR ports the
suites/tracingsuites ofcloudflare-integration-teststo span streaming. It removes thetraceLifecycle: 'static'pin from each suite, and rewrites the assertions from transaction envelopes to span v2. 23 suites, 38 tests. The twelvetracing/propagationsuites are in the PR stacked on this one.tracing/d1also loses its env-gatedSTREAMEDswitch and the static copy of its test, so one test now covers the streamed behaviour.What the runs showed
Three behaviours shaped the rewrite, and each one is worth knowing before the next package is ported.
A
urlsource segment span keeps the method only.GET /errorbecomesGET. Those suites now assertGETand read the route from theurl.pathattribute. Suites on aroutesource, such as/, keep the fullGET /name.The segment span can arrive in a later envelope than its children, because it ends last.
opentelemetry-tracer/internal-request-handlerfailed on exactly that, and now usescollectStreamedSpansUntilSegment.Start timestamps tie at millisecond resolution in workerd, so an order-based assertion over child spans is unreliable.
opentelemetry-tracer/enabledmatches spans by name instead of sorting them.Two shapes for multi-isolate traces
A worker and a Durable Object each stream their own envelope for the same trace. A suite therefore has to choose how to read them.
instrument-fetcherand the Durable Object storage suites usecollectStreamedSpans, which groups by trace and resolves once the whole trace is in hand. These are the first callers of the helper added in the base PR. They also exercise the observe-not-consume behaviour, becausedurableobject-sqlanddurableobject-sync-kvcollect spans while a flush-marker error envelope still matches an ordered expectation.The other suites keep one envelope expectation per isolate with
.unordered(), which stays closer to the shape they already had and keeps the diff readable.Part of #24147
🤖 Generated with Claude Code