Open
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Self-hosted/on-premise
Which SDK are you using?
@sentry/nextjs
SDK Version
8.42.0, 9.5.0
It is reproduced in both versions.
Framework Version
next@15.1.7
Link to Sentry event
No response
Reproduction Example/SDK Setup
DSN is internal information so it is not published, but it does not have any effect on reproducing the issue.
Sentry.init({
dsn: "john-dsn",
release: "john-release",
});
Steps to Reproduce
- project clone
- Run without commenting out the line(reproduce the problem) - pnpm dev
- Comment out the line and run it (desired behavior) - pnpm dev
Running pnpm dev and build after that gives the same result.
Expected Result
next.route must remain in BaseServer.handleRequest span_type regardless of whether sentry.init is included in the code or not
Actual Result
Additional Details
- I am using next.js and opentelemetry and prometheus together.
- At this time, we are trying to add metrics to prometheus by utilizing next.route, an opentelemetry span element provided by next.js.
- However, when running sentry.init in the instrumentation file like the sentry guide says, the next.route span element is lost in the BaseServer.handleRequest event logged in onEnd.
- When sentry.init is excluded from the code, the next.route span element remains normally.
Why does the next.route span element disappear depending on whether sentry.init is present or not?
Not shown in the image, but other span elements also change depending on sentry.init being run.
You can easily reproduce this by cloning the above repository and running the project.
Actual Result
- When sentry.init is excluded from the line


- When sentry.init is included in the line


Metadata
Metadata
Assignees
Type
Projects
Status
No status