-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NextJS Pages API Route traces are not continued from incoming trace #14787
Comments
was likely introduced in #14481 Downgrading the version in the repro to 8.42.0 fixes the issue. |
Update: These issues are probably not related after all |
Wait, I found the problem! I will open a PR to fix this 😬 We are using |
@mydea Additional thing to consider, we cannot use the opentelemetry |
…14813) We have a different implementation of `continueTrace` for OTEL/Node. Until now we relied on actually using the import from `@sentry/node` vs `@sentry/core` to ensure this. However, this is a footgun, and actually lead to a problem in NextJS because we used the core variant there. Also, it is simply not isomorphic. So to fix this, this PR puts `continueTrace` on the ACS so we can consistently use the core variant in all environments. Fixes #14787
…14813) We have a different implementation of `continueTrace` for OTEL/Node. Until now we relied on actually using the import from `@sentry/node` vs `@sentry/core` to ensure this. However, this is a footgun, and actually lead to a problem in NextJS because we used the core variant there. Also, it is simply not isomorphic. So to fix this, this PR puts `continueTrace` on the ACS so we can consistently use the core variant in all environments. Fixes #14787
…14819) V8 backport of #14813 We have a different implementation of `continueTrace` for OTEL/Node. Until now we relied on actually using the import from `@sentry/node` vs `@sentry/core` to ensure this. However, this is a footgun, and actually lead to a problem in NextJS because we used the core variant there. Also, it is simply not isomorphic. So to fix this, this PR puts `continueTrace` on the ACS so we can consistently use the core variant in all environments. Fixes #14787 Co-authored-by: Francesco Gringl-Novy <[email protected]>
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
8.46.0
Framework Version
NextJS 15.1.1
Link to Sentry event
N/A
Reproduction Example/SDK Setup
Clone my repro: https://github.com/Lms24/nextjs-trace-envelope-header
Steps to Reproduce
To reproduce:
npm install
npm run build && npm run start
sh req.sh
Observe that trace_id, sample_rate and transaction fields (+others) are not continued from incoming trace (see
req.sh
). Meaning, it seems like the NextJS SDK starts a new trace for the server-side instead of continuing the passed trace via the headers.Expected Result
baggage
trace
envelope header and sends the continued trace data inevent.context.trace
Actual Result
Additional information
The logs suggest that there might be 2 ongoing root spans which possibly(?) conflict with each other?
The text was updated successfully, but these errors were encountered: