Skip to content

Commit eb30917

Browse files
committed
add excludeServerRoutes option
1 parent 054796b commit eb30917

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/nextjs/src/config/types.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ export type UserSentryOptions = {
5959

6060
// Automatically instrument Next.js data fetching methods and Next.js API routes
6161
autoInstrumentServerFunctions?: boolean;
62+
63+
// Exclude certain serverside API routes or pages from being instrumented with Sentry. This option takes an array of
64+
// strings or regular expressions.
65+
//
66+
// NOTE: Pages should be specified as routes (`/animals` or `/api/animals/[animalType]/habitat`), not filepaths
67+
// (`pages/animals/index.js` or `.\src\pages\api\animals\[animalType]\habitat.tsx`), and strings must be be a full,
68+
// exact match.
69+
excludeServerRoutes?: Array<RegExp | string>;
6270
};
6371

6472
export type NextConfigFunction = (phase: string, defaults: { defaultConfig: NextConfigObject }) => NextConfigObject;

0 commit comments

Comments
 (0)