Description
Hello!
We have a Next.js 15 application running on Netlify using the pages router, with OpenTelemetry (for server traces) configured.
The root span emitted for each HTTP request is BaseServer.handleRequest, and according to the documentation, it should include the following span attributes:
http.method
(e.g.GET
)http.status_code
(e.g.200
)http.route
: (e.g./
)http.target
: (e.g./?foo=bar
)
When I run the application locally or self-hosted (via Docker), all of these attributes are present -- including http.route
.

However, when running the same application on Netlify, the span attribute http.route
is absent. As a result, all traces from Netlify in our observability platform (Datadog) are grouped only by HTTP method (GET
, POST
, etc.) rather than by method and route (GET /
, GET /another-route
, etc.).

I’ve opened a customer support ticket with Netlify, but since this appears to be a platform interoperability issue, I thought it would be helpful to open an issue here as well.
From what I can see, Next.js sets the http.route
attribute inside an if block:
It seems that when running on Netlify, if (route)
evaluates to false, so the else
block is executed instead.