You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Next.js: Stop setting http.route to middleware GET on proxy root spans #27067
handleMiddlewareSpanStart in packages/nextjs/src/server/serverSpanHooks.ts copies the span name of the proxy into http.route on the root span. The value is middleware GET, which is not a route.
Effect
Grouping and filtering by http.route gets a value that is not a route.
The span description becomes GET middleware GET, because it is built from the method and http.route.
To do
Do not write the proxy name into http.route.
Check that nothing depends on it. maybeHoistRouteToRootSpan skips hoisting when http.route is already set, so removing the value can change how later route spans rename the root.
Would a maintainer be open to a PR for this? I’d keep the middleware span name separate from http.route and add regression coverage for both a middleware-only response and a request that reaches a named Next.js route.
Activity
linear-code commentedon Dec 2, 2026
JS-4208
Gerakaustubh commentedon Dec 4, 2026
Would a maintainer be open to a PR for this? I’d keep the middleware span name separate from
http.routeand add regression coverage for both a middleware-only response and a request that reaches a named Next.js route.chargome commentedon Dec 4, 2026
@Gerakaustubh we'll handle this internally but thanks for reaching out!