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
Sentry creates separate otel context for dynamic pages when using @vercel/otel #12907
Hi, I am trying to better understand your desired outcome. What do traces look for you, and what would you like them to look like?
Sorry for late reply.
The desired outcome would be to have all spans from single request assigned to same trace id.
Now Sentry creates own context so all spans created by sentry and within sentry context are not assigned to original trace.
For us it's problematic since we can't see full trace by original trace id.
We do not pick up OTEL instrumentation from Next.js pages router, because we found that it has a lot of incorrect data (see OpenTelemetry: Improve Span Quality vercel/next.js#64723). For app router, the data emitted by Next.js is accurate.
Our current recommendation for you, if you are only intending to use Sentry for tracing is to ditch the @vercel/otel package. You will not get much more (if any) good data from it.
@csshsh we'll release an update to the SDK very soon that should address all of your concerns. Right now there is no workaround except for disabling @vercel/otel which btw also produces a lot of incorrect data. (see vercel/next.js#70908)
@csshsh we'll release an update to the SDK very soon that should address all of your concerns. Right now there is no workaround except for disabling @vercel/otel which btw also produces a lot of incorrect data. (see vercel/next.js#70908)
Just to avoid misunderstandings, this update to the Sentry SDK will also allow configuring Sentry in a way so it does NOT escape from the next.js tracing?
@csshsh correct. We will very strongly depend on Next.js tracing moving forward - no escapages, except for situations where we find that Next.js spans are completely inaccurate. Note that pure Sentry users without any custom setups are a priority for us right now. Not because we don't care about the others, but because this stuff is surprisingly complex and we need to converge to a stable state step by step.
This should be solved with the latest version of the SDK. Let us know if it works. (Only exception being Next.js Pages router API routes because Next.js emits completely wrong durations for those)
Activity
adam187 commentedon Jul 13, 2024
Looks like it could be related to #11625
lforst commentedon Jul 15, 2024
Hi, I am trying to better understand your desired outcome. What do traces look for you, and what would you like them to look like?
adam187 commentedon Jul 29, 2024
Sorry for late reply.
The desired outcome would be to have all spans from single request assigned to same trace id.
Now Sentry creates own context so all spans created by sentry and within sentry context are not assigned to original trace.
For us it's problematic since we can't see full trace by original trace id.
chargome commentedon Jul 29, 2024
Hi @adam187, I talked with @lforst and there are a few things to unpack:
@vercel/otelpackage. You will not get much more (if any) good data from it.22 remaining items
lforst commentedon Oct 14, 2024
@csshsh we'll release an update to the SDK very soon that should address all of your concerns. Right now there is no workaround except for disabling
@vercel/otelwhich btw also produces a lot of incorrect data. (see vercel/next.js#70908)csshsh commentedon Oct 14, 2024
Just to avoid misunderstandings, this update to the Sentry SDK will also allow configuring Sentry in a way so it does NOT escape from the next.js tracing?
lforst commentedon Oct 14, 2024
@csshsh correct. We will very strongly depend on Next.js tracing moving forward - no escapages, except for situations where we find that Next.js spans are completely inaccurate. Note that pure Sentry users without any custom setups are a priority for us right now. Not because we don't care about the others, but because this stuff is surprisingly complex and we need to converge to a stable state step by step.
lforst commentedon Nov 6, 2024
This should be solved with the latest version of the SDK. Let us know if it works. (Only exception being Next.js Pages router API routes because Next.js emits completely wrong durations for those)
adam187 commentedon Mar 12, 2025
I finally had some time to upgrade Sentry again, looks like it's working now as expected now 🙇