Detach local spans from propagated contexts - #97026
Draft
DavidIlie wants to merge 1 commit into
Draft
Conversation
Contributor
Stats from current PR🟢 1 improvement
📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
Build Cache
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📎 Tarball URLCommit: 815d285 |
Contributor
Tests PassedCommit: 815d285 |
DavidIlie
force-pushed
the
codex/websocket-tracing-prerequisite
branch
2 times, most recently
from
August 10, 2026 16:29
6e5d71e to
8d5f674
Compare
DavidIlie
force-pushed
the
codex/websocket-tracing-prerequisite
branch
from
August 17, 2026 13:00
8d5f674 to
815d285
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.
What?
Add a tracing primitive for running work outside both the current local span and the propagated OpenTelemetry context.
Why?
Long-lived work must not inherit a request span after that request has completed. WebSocket connection hooks need this behavior, but the underlying context-restoration contract also applies independently to middleware tracing.
How?
runWithoutLocalSpan()to the local span recorder.This is the first PR in the experimental WebSocket Route Handler stack. The transport and public API are added by the following PRs.
Verification
pnpm exec jest --runInBand packages/next/src/server/lib/trace/tracer.test.ts