Skip to content

Keep middleware and render in one OpenTelemetry trace as siblings - #100294

Merged
mischnic merged 13 commits into
fleet/otel-request-span-before-preparefrom
fleet/otel-prepare-route-module-in-request-span
Oct 21, 2026
Merged

mischnic merged 13 commits into
fleet/otel-request-span-before-preparefrom
fleet/otel-prepare-route-module-in-request-span

Conversation

@sokra

@sokra sokra commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Summary

Stacked on #100349 (request span before route module preparation).

Relands #100136 (reverted in f1a69d7) and changes the span shape so middleware and the route are siblings in one trace per request.

Resulting shapes

next start / next dev:
 handleRequest GET (bubble, root)
  ├─ middleware GET
  └─ GET /page

next start / next dev with host span / incoming traceparent P:
 P
  └─ handleRequest GET (bubble)
      ├─ middleware GET
      └─ GET /page

separately-invoked middleware (Vercel, adapters, direct entrypoints), no parent:
 GET (Next.request, root, inserted by the middleware adapter)
  ├─ middleware GET
  └─ GET /page

separately-invoked middleware with host span / incoming traceparent P:
 P
  ├─ middleware GET
  └─ GET /page

How

  • Self-hosted: next-server's middleware-invoke handleRequest pass writes its W3C context onto the request (traceparent, and tracestate only together with it: a received tracestate is removed when the context has none). Middleware (Node in-process, or the Edge sandbox via the header) and the render pass both continue it. The render pass forces that extraction even under an active host span (custom server / APM), so it nests under the bubble span; a different traceparent the middleware explicitly set still wins.
  • Middleware adapter: an active host span wins over a request traceparent; otherwise the request's traceparent is continued, and the middleware never changes it. Without any valid context (and OTEL enabled) the adapter inserts a Next.request SERVER span (new NextSpan enum) named after the method (http.target keeps the path). When the downstream request doesn't already carry that shared parent, its traceparent/tracestate are forwarded via the existing x-middleware-request-* overrides, always as a pair: a user-set traceparent keeps exactly the trace headers the user set. No headers are added without OTEL.
    • Request-header overrides replace the whole header set, so when the user set no overrides, the received headers are listed alongside the trace headers. There's no API to add a single header yet; that needs a server and platform change.
  • Node middleware is no longer detached via ROOT_CONTEXT (the 16.3 regression from otel: Use correct parent span for Node.js middleware #95306).

The inserted Next.request root ends when the middleware finishes, so the render child (a separate invocation) can outlive it.

Verification

  • Trace shapes are asserted as printed span trees (test/lib/otel-span-tree.ts, from Start the request span before route module preparation #100349) in inline snapshots. Span IDs are normalized away, but distinct traces keep distinct labels, so a split trace shows up as [trace A] / [trace B].
  • test/e2e/app-dir/otel-middleware-trace (added in Start the request span before route module preparation #100349 with the previous behavior): this PR's snapshot diff shows middleware and render becoming siblings in one trace, in dev, start, Cache Components and deploy, for Node.js and Edge middleware and behind a custom server with a host span (including an incoming tracestate not being paired with the host span's context).
  • Collector suite test/e2e/opentelemetry/instrumentation: the middleware test asserts the full span tree in next start/dev, direct entrypoints with/without host span, and the custom server (host span, user-set traceparent).
  • Unit tests for the tracer and forwardTraceContextToRequest changes.
  • test/e2e/middleware-request-header-overrides, test/production/typescript-basic, test/production/middleware-typescript pass.

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Tests Passed

Commit: 3eb2a20

@sokra
sokra force-pushed the fleet/otel-prepare-route-module-in-request-span branch from 0c905d6 to 8aaa306 Compare October 16, 2026 15:56
@sokra sokra changed the title Keep route module preparation inside the request's trace for direct entrypoints Keep middleware and route spans as siblings in a single OpenTelemetry trace Oct 16, 2026
@sokra
sokra added this pull request to stack #100325 October 16, 2026 17:05

sokra commented Oct 16, 2026

Copy link
Copy Markdown
Member Author

This PR can be split logically into two parts to make it easier to review. Use stacked PRs:

  • Start the request span before route module preparation
  • Keep middleware and render in one trace

@sokra
sokra force-pushed the fleet/otel-prepare-route-module-in-request-span branch from 8aaa306 to 68f714b Compare October 17, 2026 11:03
@sokra
sokra removed this pull request from stack #100325 October 17, 2026 11:05
@sokra
sokra changed the base branch from canary to fleet/otel-request-span-before-prepare October 17, 2026 11:05
@sokra
sokra added this pull request to stack #100351 October 17, 2026 11:05
@sokra sokra changed the title Keep middleware and route spans as siblings in a single OpenTelemetry trace Keep middleware and render in one OpenTelemetry trace as siblings Oct 17, 2026
@vercel-fleet-prod

Copy link
Copy Markdown
Contributor

Split as requested (#100294 (comment)). Stack #100351, bottom to top, all rebased on current canary:

  1. Start the request span before route module preparation #100349: start the request span before route module preparation (+ @internal declaration fix)
  2. Keep middleware and render in one OpenTelemetry trace as siblings #100294 (this PR): reapply Keep requests through middleware in a single OpenTelemetry trace #100136 + middleware/render sibling spans
  3. docs: note that instrumentation-time spans don't join request traces #100324: docs note on instrumentation-time spans
  4. Emit instrumentation lifecycle spans in the request that registered it #100350: emit the instrumentation.ts lifecycle spans in the request that registered it

Each layer was verified on its own (types, OTEL suite in start mode, single-trace suite where present, unit tests). The trees of #100294 and #100324 are unchanged apart from canary.

@sokra
sokra force-pushed the fleet/otel-prepare-route-module-in-request-span branch from 68f714b to ed0abbb Compare October 19, 2026 11:25
@mischnic
mischnic force-pushed the fleet/otel-prepare-route-module-in-request-span branch from ed0abbb to f020ddc Compare October 19, 2026 15:20
@mischnic

mischnic commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

The tests seem way too complicated. I'm not reading all of that

i.e. just slightly adapting this test should be enough:

for (const env of [
{
name: 'root context',
fetchInit: undefined,
span: {
traceId: '[trace-id]',
rootParentId: undefined,
},
},
{
name: 'incoming context propagation',
fetchInit: {
headers: {
traceparent: `00-${EXTERNAL.traceId}-${EXTERNAL.spanId}-01`,
},
},
span: {
traceId: EXTERNAL.traceId,
rootParentId: EXTERNAL.spanId,
},
},
]) {
;(process.env.__NEXT_CACHE_COMPONENTS ? describe.skip : describe)(
env.name,
() => {
it('should trace middleware', async () => {
await next.fetch('/behind-middleware', env.fetchInit)
let expected = [
{
runtime: runtime,
traceId: env.span.traceId,
parentId: env.span.rootParentId,
name: 'middleware GET',
attributes: {
'http.method': 'GET',
'http.target': '/behind-middleware',
'next.span_name': 'middleware GET',
'next.span_type': 'Middleware.execute',
},
status: { code: 0 },
spans: [],
},
{
runtime: 'nodejs',
traceId: env.span.traceId,
parentId: env.span.rootParentId,
name: 'GET /behind-middleware',
attributes: {
'http.method': 'GET',
'http.route': '/behind-middleware',
'http.status_code': 200,
'http.target': '/behind-middleware',
'next.route': '/behind-middleware',
'next.span_name': 'GET /behind-middleware',
'next.span_type': 'BaseServer.handleRequest',
},
},
]

@vercel-fleet-prod

Copy link
Copy Markdown
Contributor

Thanks. I simplified the tests in e73398a:

  • Trace shapes are now asserted as readable span-tree inline snapshots via a small shared printer (test/lib/otel-span-tree.ts), replacing the handwritten sibling and ancestry checks and expectSingleTrace.
  • In the collector suite, the existing middleware test is adapted to snapshot the full span tree instead of the hand-rolled assertions.
  • The deploy-capable otel-middleware-single-trace suite stays, because it is our only coverage of the deployed behaviour, but each case is now one tree snapshot.
  • The new unit tests are trimmed to the core forwarding cases.

The deploy-mode snapshots will be filled in from the first deploy CI run.

vercel-fleet-prod Bot and others added 8 commits October 21, 2026 13:32
Co-authored-by: Tobias Koppers <[email protected]>
Co-authored-by: Luke Sandberg <[email protected]>
Co-authored-by: Niklas Mischkulnig <[email protected]>
Include one-time spans in the first span tree, test generateMetadata spans, move custom-server coverage to the deploy-capable suite, and restore attribute-validating collector assertions.

Co-authored-by: Tobias Koppers <[email protected]>
Co-authored-by: Luke Sandberg <[email protected]>
Co-authored-by: Niklas Mischkulnig <[email protected]>
Co-authored-by: Tobias Koppers <[email protected]>
Co-authored-by: Luke Sandberg <[email protected]>
Co-authored-by: Niklas Mischkulnig <[email protected]>
Co-authored-by: Tobias Koppers <[email protected]>
Co-authored-by: Luke Sandberg <[email protected]>
Co-authored-by: Niklas Mischkulnig <[email protected]>
Co-authored-by: Tobias Koppers <[email protected]>
Co-authored-by: Luke Sandberg <[email protected]>
Co-authored-by: Niklas Mischkulnig <[email protected]>
Name the inserted middleware request span by method, keep traceparent and tracestate together, and let an active host span win over an incoming traceparent for middleware.

Co-authored-by: Tobias Koppers <[email protected]>
Co-authored-by: Luke Sandberg <[email protected]>
Co-authored-by: Niklas Mischkulnig <[email protected]>
Co-authored-by: Tobias Koppers <[email protected]>
Co-authored-by: Luke Sandberg <[email protected]>
Co-authored-by: Niklas Mischkulnig <[email protected]>
Co-authored-by: Tobias Koppers <[email protected]>
Co-authored-by: Luke Sandberg <[email protected]>
Co-authored-by: Niklas Mischkulnig <[email protected]>
@sokra
sokra force-pushed the fleet/otel-prepare-route-module-in-request-span branch from 60d9245 to 17c1aba Compare October 21, 2026 13:32

sokra commented Oct 21, 2026

Copy link
Copy Markdown
Member Author

Reviewed 17c1aba

@sokra
sokra marked this pull request as ready for review October 21, 2026 14:37
@sokra
sokra requested a review from mischnic October 21, 2026 14:58
Co-authored-by: Tobias Koppers <[email protected]>
Co-authored-by: Luke Sandberg <[email protected]>
Co-authored-by: Niklas Mischkulnig <[email protected]>
@mischnic
mischnic merged commit 4abb437 into canary Oct 21, 2026
120 checks passed
@mischnic
mischnic deleted the fleet/otel-prepare-route-module-in-request-span branch October 21, 2026 18:30
mischnic added a commit that referenced this pull request Oct 21, 2026
## Summary

Bottom of a stack: this PR → #100294 → #100324 → #100350 → #100392.

In direct entrypoints (Vercel, adapters, standalone handlers, i.e.
without next-server), `prepare route module` ran before the request span
started. Since 16.4 every request therefore produced an extra parentless
`prepare route module` trace next to the request trace. Now it is part
of the request span:

```
[P →] GET /page (BaseServer.handleRequest)
       └─ prepare route module → render …
```

### How

- New `RouteModule.traceRequest` (`@internal`, kept out of the published
declaration types) starts the request span **before** `prepare`. It uses
the caller's tracer. When the handler is wrapped by next-server, which
already started the request span, it runs inside that active span
instead.
- Callers first await the new `RouteModule.ensureInstrumentation`
(`@internal`), split out of `prepareImpl`: it registers
`instrumentation.ts`, which usually installs the tracer provider, so a
span started earlier would not be recorded. `prepareImpl` still calls
it, and patches `res.setHeader` as before.
- The app-page, app-route, pages and pages-api templates/handlers call
`ensureInstrumentation` and then `traceRequest`, and handle the response
through one code path: `traceRequest` passes the request span and the
request's root span (the span that was active when the handler was
invoked — next-server's request span or a platform/host span — or the
request span itself), and the route name is propagated to the root span
when it isn't the request span.
- Parenting of the request span itself (incoming `traceparent`, host
span, root) is unchanged.

## Verification

- Collector suite `test/e2e/opentelemetry/instrumentation`: direct
entrypoint cold and warm requests for all four handler types, with and
without an incoming `traceparent` and with a host span, assert
`RouteModule.prepare` is inside the request's trace, and route names on
the request and parent spans.
- New deploy-capable e2e suite `test/e2e/app-dir/otel-middleware-trace`
(moved down from #100294): `proxy.ts` and Edge `middleware.ts` variants,
plus a custom server with a host span. The app records its spans with a
SpanProcessor; the middleware and the render report the spans they can
see, and the test asserts the stitched span tree (with `http.target`,
`http.route`, `next.route` and `http.status_code` where set at report
time) in inline snapshots for pages, route handlers, rewrites,
redirects, direct responses, matcher misses, incoming `traceparent`,
header overrides and a middleware-set `traceparent`, in dev, start,
Cache Components and deploy. Here it records the current behavior
(middleware and render in separate traces); #100294 shows the change.
- Unit tests for the tracer changes (`tracer.test.ts`).

<!-- NEXT_JS_LLM -->


<!-- fleet ce0ecb23-b14c-4679-92a9-e676130f618e -->

---------

Co-authored-by: vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com>
Co-authored-by: Niklas Mischkulnig <[email protected]>
Co-authored-by: Tobias Koppers <[email protected]>
Co-authored-by: Luke Sandberg <[email protected]>
mischnic added a commit that referenced this pull request Oct 21, 2026
…100324)

## Summary

Stacked on #100294.

Documents in the OpenTelemetry guide that spans created while
`instrumentation.ts` loads or inside `register()` don't automatically
join a request trace:

- Spans started before the tracer provider is installed (e.g. at module
top level before `registerOTel()`) are not recorded.
- Spans started inside `register()` after `registerOTel()` / the SDK has
started typically become separate root traces: the SDK installs the
context manager during `register()`, so no parent context set before
that is carried over.

It also clarifies the existing sentence so it refers to spans created
while handling a request, and recommends creating request-scoped spans
in request-handling code.

Making these spans nest under a Next.js span would require Next.js to
install its own global OpenTelemetry context manager before loading
`instrumentation.ts`; that was decided against, so this documents the
behavior instead.

## Verification

- Reproduced with `@opentelemetry/api`,
`@opentelemetry/context-async-hooks` and
`@opentelemetry/sdk-trace-base`: a span started before the provider
exists isn't exported; a span started after installing provider +
context manager inside a function wrapped in `context.with(parent, …)`
has no parent; the same `context.with` after the manager exists parents
correctly.

<!-- NEXT_JS_LLM -->


<!-- fleet ce0ecb23-b14c-4679-92a9-e676130f618e -->

Co-authored-by: vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com>
Co-authored-by: Tobias Koppers <[email protected]>
Co-authored-by: Luke Sandberg <[email protected]>
Co-authored-by: Niklas Mischkulnig <[email protected]>
mischnic pushed a commit that referenced this pull request Oct 21, 2026
## Summary

Bottom of a stack: this PR → #100294 → #100324 → #100350 → #100392.

In direct entrypoints (Vercel, adapters, standalone handlers, i.e.
without next-server), `prepare route module` ran before the request span
started. Since 16.4 every request therefore produced an extra parentless
`prepare route module` trace next to the request trace. Now it is part
of the request span:

```
[P →] GET /page (BaseServer.handleRequest)
       └─ prepare route module → render …
```

### How

- New `RouteModule.traceRequest` (`@internal`, kept out of the published
declaration types) starts the request span **before** `prepare`. It uses
the caller's tracer. When the handler is wrapped by next-server, which
already started the request span, it runs inside that active span
instead.
- Callers first await the new `RouteModule.ensureInstrumentation`
(`@internal`), split out of `prepareImpl`: it registers
`instrumentation.ts`, which usually installs the tracer provider, so a
span started earlier would not be recorded. `prepareImpl` still calls
it, and patches `res.setHeader` as before.
- The app-page, app-route, pages and pages-api templates/handlers call
`ensureInstrumentation` and then `traceRequest`, and handle the response
through one code path: `traceRequest` passes the request span and the
request's root span (the span that was active when the handler was
invoked — next-server's request span or a platform/host span — or the
request span itself), and the route name is propagated to the root span
when it isn't the request span.
- Parenting of the request span itself (incoming `traceparent`, host
span, root) is unchanged.

## Verification

- Collector suite `test/e2e/opentelemetry/instrumentation`: direct
entrypoint cold and warm requests for all four handler types, with and
without an incoming `traceparent` and with a host span, assert
`RouteModule.prepare` is inside the request's trace, and route names on
the request and parent spans.
- New deploy-capable e2e suite `test/e2e/app-dir/otel-middleware-trace`
(moved down from #100294): `proxy.ts` and Edge `middleware.ts` variants,
plus a custom server with a host span. The app records its spans with a
SpanProcessor; the middleware and the render report the spans they can
see, and the test asserts the stitched span tree (with `http.target`,
`http.route`, `next.route` and `http.status_code` where set at report
time) in inline snapshots for pages, route handlers, rewrites,
redirects, direct responses, matcher misses, incoming `traceparent`,
header overrides and a middleware-set `traceparent`, in dev, start,
Cache Components and deploy. Here it records the current behavior
(middleware and render in separate traces); #100294 shows the change.
- Unit tests for the tracer changes (`tracer.test.ts`).

<!-- NEXT_JS_LLM -->

<!-- fleet ce0ecb23-b14c-4679-92a9-e676130f618e -->

---------

Co-authored-by: vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com>
Co-authored-by: Niklas Mischkulnig <[email protected]>
Co-authored-by: Tobias Koppers <[email protected]>
Co-authored-by: Luke Sandberg <[email protected]>
(cherry picked from commit e3c2f63)

Co-authored-by: Tobias Koppers <[email protected]>
mischnic pushed a commit that referenced this pull request Oct 21, 2026
…00294)

## Summary

Stacked on #100349 (request span before route module preparation).

Relands #100136 (reverted in f1a69d7) and changes the span shape so
middleware and the route are **siblings** in one trace per request.

### Resulting shapes

```
next start / next dev:
 handleRequest GET (bubble, root)
  ├─ middleware GET
  └─ GET /page

next start / next dev with host span / incoming traceparent P:
 P
  └─ handleRequest GET (bubble)
      ├─ middleware GET
      └─ GET /page

separately-invoked middleware (Vercel, adapters, direct entrypoints), no parent:
 GET (Next.request, root, inserted by the middleware adapter)
  ├─ middleware GET
  └─ GET /page

separately-invoked middleware with host span / incoming traceparent P:
 P
  ├─ middleware GET
  └─ GET /page
```

### How

- **Self-hosted:** next-server's middleware-invoke `handleRequest` pass
writes its W3C context onto the request (`traceparent`, and `tracestate`
only together with it: a received `tracestate` is removed when the
context has none). Middleware (Node in-process, or the Edge sandbox via
the header) and the render pass both continue it. The render pass forces
that extraction even under an active host span (custom server / APM), so
it nests under the bubble span; a different `traceparent` the middleware
explicitly set still wins.
- **Middleware adapter:** an active host span wins over a request
`traceparent`; otherwise the request's `traceparent` is continued, and
the middleware never changes it. Without any valid context (and OTEL
enabled) the adapter inserts a `Next.request` SERVER span (new
`NextSpan` enum) named after the method (`http.target` keeps the path).
When the downstream request doesn't already carry that shared parent,
its `traceparent`/`tracestate` are forwarded via the existing
`x-middleware-request-*` overrides, always as a pair: a user-set
`traceparent` keeps exactly the trace headers the user set. No headers
are added without OTEL.
- Request-header overrides replace the whole header set, so when the
user set no overrides, the received headers are listed alongside the
trace headers. There's no API to add a single header yet; that needs a
server and platform change.
- Node middleware is no longer detached via `ROOT_CONTEXT` (the 16.3
regression from #95306).

The inserted `Next.request` root ends when the middleware finishes, so
the render child (a separate invocation) can outlive it.

## Verification

- Trace shapes are asserted as printed span trees
(`test/lib/otel-span-tree.ts`, from #100349) in inline snapshots. Span
IDs are normalized away, but distinct traces keep distinct labels, so a
split trace shows up as `[trace A]` / `[trace B]`.
- `test/e2e/app-dir/otel-middleware-trace` (added in #100349 with the
previous behavior): this PR's snapshot diff shows middleware and render
becoming siblings in one trace, in dev, start, Cache Components and
deploy, for Node.js and Edge middleware and behind a custom server with
a host span (including an incoming `tracestate` not being paired with
the host span's context).
- Collector suite `test/e2e/opentelemetry/instrumentation`: the
middleware test asserts the full span tree in next start/dev, direct
entrypoints with/without host span, and the custom server (host span,
user-set `traceparent`).
- Unit tests for the tracer and `forwardTraceContextToRequest` changes.
- `test/e2e/middleware-request-header-overrides`,
`test/production/typescript-basic`,
`test/production/middleware-typescript` pass.

<!-- NEXT_JS_LLM -->

<!-- fleet ce0ecb23-b14c-4679-92a9-e676130f618e -->

---------

Co-authored-by: vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com>
Co-authored-by: Tobias Koppers <[email protected]>
Co-authored-by: Luke Sandberg <[email protected]>
Co-authored-by: Niklas Mischkulnig <[email protected]>
(cherry picked from commit 4abb437)

Co-authored-by: Tobias Koppers <[email protected]>
mischnic pushed a commit that referenced this pull request Oct 21, 2026
…100324)

## Summary

Stacked on #100294.

Documents in the OpenTelemetry guide that spans created while
`instrumentation.ts` loads or inside `register()` don't automatically
join a request trace:

- Spans started before the tracer provider is installed (e.g. at module
top level before `registerOTel()`) are not recorded.
- Spans started inside `register()` after `registerOTel()` / the SDK has
started typically become separate root traces: the SDK installs the
context manager during `register()`, so no parent context set before
that is carried over.

It also clarifies the existing sentence so it refers to spans created
while handling a request, and recommends creating request-scoped spans
in request-handling code.

Making these spans nest under a Next.js span would require Next.js to
install its own global OpenTelemetry context manager before loading
`instrumentation.ts`; that was decided against, so this documents the
behavior instead.

## Verification

- Reproduced with `@opentelemetry/api`,
`@opentelemetry/context-async-hooks` and
`@opentelemetry/sdk-trace-base`: a span started before the provider
exists isn't exported; a span started after installing provider +
context manager inside a function wrapped in `context.with(parent, …)`
has no parent; the same `context.with` after the manager exists parents
correctly.

<!-- NEXT_JS_LLM -->

<!-- fleet ce0ecb23-b14c-4679-92a9-e676130f618e -->

Co-authored-by: vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com>
Co-authored-by: Tobias Koppers <[email protected]>
Co-authored-by: Luke Sandberg <[email protected]>
Co-authored-by: Niklas Mischkulnig <[email protected]>
(cherry picked from commit 60e6807)

Co-authored-by: Tobias Koppers <[email protected]>
mischnic pushed a commit that referenced this pull request Oct 22, 2026
…0294, #100324, #100350, #100552, #100583) (#100542)

Backports the OpenTelemetry request-trace stack to
`releases/lts/active`:

- #100349 Start the request span before route module preparation
- #100294 Keep middleware and render in one OpenTelemetry trace as
siblings (re-lands #100136, whose LTS backport #100226 was reverted in
#100269)
- #100324 docs: note that instrumentation-time spans don't join request
traces
- #100350 Emit instrumentation lifecycle spans in the request that
registered it
- #100552 Preserve deferred middleware instrumentation spans when the
adapter throws
- #100583 test: add non-adapter deploy snapshots to
otel-middleware-trace. Without it, `otel-middleware-trace` fails the
release deploy tests that deploy with `NEXT_ENABLE_ADAPTER=0`, as on
v16.5.0-canary.23.

The six canary merge commits are cherry-picked in order with `-x`, and
all applied cleanly. The patch content is identical to canary's; only
blob IDs and line offsets differ.

## Verification

- `test/e2e/opentelemetry/instrumentation/`: `test-start-turbo` (122
passed) and `test-dev-turbo` (67 passed). The #100552 regression test
fails without its `middleware.ts` change.
- `test/e2e/app-dir/otel-middleware-trace`: `test-start-turbo`,
`test-dev-turbo` and `test-start-webpack` (30 passed each, inline
snapshots unchanged). The #100583 commit leaves the test file
byte-identical to canary's.
- Unit tests for `instrumentation-globals`, `tracer` and
`forward-trace-context` (40 passed), plus `pnpm --filter=next types`
- Built with `CI=true pnpm build-all` against the published `@next/swc`
16.4.2 binary. The backport touches no Rust.
- PR CI deploys only through the adapter, so the non-adapter snapshots
from #100583 are confirmed by the next release deploy run.

<!-- NEXT_JS_LLM -->


<!-- fleet ce0ecb23-b14c-4679-92a9-e676130f618e -->

---------

Co-authored-by: vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com>
Co-authored-by: Luke Sandberg <[email protected]>
@github-actions github-actions Bot added the locked label Nov 5, 2026
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants