-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Problem Statement
Hey there! π
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?
Sentry.init({
suppressInstrumentationWarning: boolean
});
- If
tracesSampleRate
is set to0
in theinstrumentation-client.ts
file, don't print the warning?
Metadata
Metadata
Assignees
Labels
Projects
Status