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
In that case you can also skip the `sentry-cli` configuration step below.
222
222
223
-
### Automatically Instrument API Routes And Data Fetching Methods
223
+
### Disable Automatic Instrumentation of API Routes And Data Fetching Methods
224
224
225
225
_(New in version TODO)_
226
226
227
-
The SDK provides an option to automatcally instrument API routes and [Next.js Data Fetching Methods](https://nextjs.org/docs/basic-features/data-fetching/overview) with error and performance monitoring, removing the need to manually wrap API routes in `withSentry`.
227
+
The SDK will automatically instrument API routes and serverside [Next.js Data Fetching Methods](https://nextjs.org/docs/basic-features/data-fetching/overview) with error and performance monitoring To turn it off, set the `autoInstrumentServerFunctions` to `false`.
228
228
229
229
```javascript {filename:next.config.js}
230
230
constmoduleExports= {
231
231
sentry: {
232
-
autoInstrumentServerFunctions:true,
232
+
autoInstrumentServerFunctions:false,
233
233
},
234
234
};
235
235
```
236
236
237
-
Under the hood, the SDK is using a Webpack loader to wrap all your API route handlers and data fetching methods.
237
+
Under the hood, when using this option, the SDK is utilizing a Webpack loader to wrap all your API route handlers and data fetching methods.
238
+
239
+
In case the automatic instrumentation does not work for your use-case, API routes can also be wrapped manually using the `withSentry` function.
Data Fetching Methods can also be manually wrapped using the following functions:
263
+
264
+
-`withSentryServerSideGetInitialProps` for `getInitialProps`
265
+
-`withSentryGetServerSideProps` for `getServerSideProps`
266
+
-`withSentryGetStaticProps` for `getStaticProps`
267
+
-`withSentryServerSideErrorGetInitialProps` for `getInitialProps` in [custom Error pages](https://nextjs.org/docs/advanced-features/custom-error-page)
268
+
-`withSentryServerSideAppGetInitialProps` for `getInitialProps` in [custom `App` components](https://nextjs.org/docs/advanced-features/custom-app)
269
+
-`withSentryServerSideDocumentGetInitialProps` for `getInitialProps` in [custom `Document` components](https://nextjs.org/docs/advanced-features/custom-document)
0 commit comments