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
We use @opentelemetry for instrumentation in our NextJS app, meaning we have no need for the built-in Sentry tracing.
I have disabled it for both the client and server config using tracesSampleRate: 0.
In the instrumentation-client.ts file, I have omitted the export const onRouterTransitionStart = Sentry.captureRouterTransitionStart; line as we have no need for it.
Now we get this warning whenever the app is built:
[@sentry/nextjs] ACTION REQUIRED: To instrument navigations, the Sentry SDK requires you to export an `onRouterTransitionStart` hook from your `instrumentation-client.(js|ts)` file. You can do so by adding `export const onRouterTransitionStart = Sentry.captureRouterTransitionStart;` to the file.
It would be great to have a mechanism to suppress this warning as it just produces noise in our case.
Thanks for taking the time to read this. 🙂
PS: If I completely misunderstood the point behind the onRouterTransitionStart = Sentry.captureRouterTransitionStart; line, I would love to know.
Solution Brainstorm
I could see a few ways to achieve this:
Provide a Sentry.init() setting to modify this behavior?
Hey @eseyfert thanks for writing in! We need captureRouterTransitionStart for instrumenting client-side routing but if you provide your own setup it def makes sense to not show this warning – I'll add a flag for disabling the warning!
Also a side note, setting tracesSampleRate: 0does not disable tracing! you should not set this attribute at all, instead. We should likely document this better, I added an issue here: getsentry/sentry-docs#14267
Activity
chargome commentedon Jul 7, 2025
Hey @eseyfert thanks for writing in! We need
captureRouterTransitionStartfor instrumenting client-side routing but if you provide your own setup it def makes sense to not show this warning – I'll add a flag for disabling the warning!mydea commentedon Jul 7, 2025
Also a side note, setting
tracesSampleRate: 0does not disable tracing! you should not set this attribute at all, instead. We should likely document this better, I added an issue here: getsentry/sentry-docs#14267TLDR you should likely use
__SENTRY_TRACING__to fully disable tracing code: https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/tree-shaking/eseyfert commentedon Jul 7, 2025
Thank you so much for the quick answers and insights! 💯
github-actions commentedon Jul 9, 2025
A PR closing this issue has just been released 🚀
This issue was referenced by PR #16823, which was included in the 9.36.0 release.