feat(nextjs): Remove tracing from middleware wrappers - #18456
Merged
logaretm merged 1 commit intoJul 24, 2026
Conversation
Contributor
node-overhead report 🧳Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.
|
logaretm
force-pushed
the
awad/js-1208-remove-tracing-from-middleware-template
branch
2 times, most recently
from
December 16, 2025 20:46
1239a7e to
7f472ff
Compare
Contributor
|
This pull request has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you apply the label |
logaretm
force-pushed
the
awad/js-1208-remove-tracing-from-middleware-template
branch
2 times, most recently
from
July 21, 2026 15:28
4ab8735 to
098a86b
Compare
Contributor
size-limit report 📦
|
logaretm
force-pushed
the
awad/js-1208-remove-tracing-from-middleware-template
branch
from
July 21, 2026 15:42
098a86b to
cd33bb0
Compare
logaretm
force-pushed
the
awad/js-1208-remove-tracing-from-middleware-template
branch
from
July 21, 2026 18:19
cd33bb0 to
64ce1ee
Compare
logaretm
added a commit
that referenced
this pull request
Jul 21, 2026
Drops the dedicated `nextjs-13` e2e test app (and its `canary.yml` matrix entry) ahead of removing Next.js 13 support in v11. Also removes the `isNext13` guards and the `nextjsVersion.ts` helpers from the pages-dir and app-dir suites. Those were dead code: both apps are pinned to Next 14, so the guarded branches never ran. Unwrapping them is behavior-preserving. Base of a stack. The middleware wrapper change in #18456 sits on top.
logaretm
force-pushed
the
awad/js-1208-remove-tracing-from-middleware-template
branch
from
July 21, 2026 18:38
64ce1ee to
03043ca
Compare
logaretm
marked this pull request as ready for review
July 21, 2026 18:38
logaretm
requested review from
chargome and
nicohrubec
and removed request for
a team
July 21, 2026 18:38
chargome
approved these changes
Jul 22, 2026
Drops the manually-created span from the middleware wrapper. On Next.js 14+ the native OTel middleware span (normalized by enhanceMiddlewareRootSpan) already produces the middleware transaction, so the wrapper only forks an isolation scope, binds it to the native root span, captures errors, and flushes. Keeps withIsolationScope + setCapturedScopesOnSpan so per-request isolation still holds and global-scope data does not leak into the middleware transaction.
logaretm
force-pushed
the
awad/js-1208-remove-tracing-from-middleware-template
branch
from
July 24, 2026 13:27
03043ca to
33b6d7e
Compare
logaretm
deleted the
awad/js-1208-remove-tracing-from-middleware-template
branch
July 24, 2026 13:57
chargome
added a commit
that referenced
this pull request
Jul 27, 2026
Aligns the Next.js middleware span op with the `@sentry/conventions` `WEB_SERVER_MIDDLEWARE_SPAN_OP` (`middleware`), replacing the previous `http.server.middleware`. The mixed `http.server`-family op was problematic for span streaming and description inference. Also adds regression coverage asserting the middleware wrapper does not start its own span (the duplicate was already removed in #18456). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
chargome
added a commit
that referenced
this pull request
Jul 27, 2026
Aligns the Next.js middleware span op with the `@sentry/conventions` `middleware`, replacing the previous `http.server.middleware`. The duplicate middleware span this issue also described was already resolved separately in #18456 (the build-time wrapper no longer starts its own span); this PR adds the regression test coverage that was missing there. closes #22636 Co-authored-by: Claude Opus 4.8 (1M context) <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 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.
closes #18308