excludeServerRoutes
for all APIs with prefix not working
#9595
Answered
by
sujanbasnet1
sujanbasnet1
asked this question in
Q&A
-
Hi there. I'm trying to exclude all Next JS APIs from auto instrumentation with a prefix but it does not seem to work. If I specify individual routes then it does. // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#opt-out-of-auto-instrumentation-on-specific-routes
const nextConfig = {
sentry: {
excludeServerRoutes: [
"/api/test", // this works
/^\/api/ // this does not
],
},
}; |
Beta Was this translation helpful? Give feedback.
Answered by
sujanbasnet1
Nov 21, 2023
Replies: 1 comment 3 replies
-
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi again. I was wrapping the APIs with
withSentry()
which I guess is explicitly saying to include these routes, soexcludingServerRoutes
was perhaps ignored. Theprefix
pattern worked after I removed it. Thanks for the help folks.