fix(tracing): retain request spans through response streams - #3268
james-elicx wants to merge 2 commits into
Conversation
|
/bigbonk review for issues. Please focus on streamed request-span lifetime, failure/cancellation settlement, Workerd Response host-state preservation, and fully-buffered response behavior. You have an 8-minute time limit; report only actionable findings you can establish within it. |
|
error: Your local changes to the following files would be overwritten by checkout: |
|
@james-elicx Bonk workflow failed. Check the logs for details. View workflow run · To retry, trigger Bonk again. |
@vinext/cloudflare
create-vinext-app
@vinext/types
vinext
@cloudflare/workers-response-store
commit: |
|
Performance benchmarksCompared 0 improved · 0 regressed · 6 within ±1.5%
View detailed results and traces 🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head |
Summary
BaseServer.handleRequesttrace active until a streamed response reaches EOF or is cancelledContent-Length@sentry/nextjsWorkerd fixtureNext.js and runtime parity
The request root now covers the response producer lifetime on both Node and Workers. The implementation remains backend-neutral: Sentry/OpenTelemetry and Workers tracing consume the same framework span, with no Sentry runtime code and no required OpenTelemetry dependency.
The Workerd regression deliberately fails with the old plain
ResponseInitreconstruction because it double-encodes a manual gzip body. Fully buffered metadata responses remain unwrapped and retain their wire-levelContent-Length.Validation
vp checkvp test run tests/request-tracing.test.ts tests/workers-tracing.test.ts tests/after-response-close-worker.test.ts(27 passed)vp run vinext#buildPLAYWRIGHT_PROJECT=cloudflare-sentry-app pnpm run test:e2e(16 passed)Stack parent: #3267