|
1 | | -import * as Sentry from '@sentry/nextjs'; |
| 1 | +// import * as Sentry from '@sentry/nextjs'; |
2 | 2 |
|
3 | | -export function register() { |
4 | | - if (process.env.NEXT_RUNTIME === 'nodejs') { |
5 | | - Sentry.init({ |
6 | | - dsn: process.env.SENTRY_DSN, |
7 | | - tracesSampleRate: 1, |
8 | | - enableLogs: true, |
9 | | - debug: false, |
10 | | - environment: process.env.NODE_ENV === 'development' ? 'development' : undefined, |
11 | | - spotlight: process.env.NODE_ENV === 'development', |
12 | | - integrations: [Sentry.consoleLoggingIntegration()], |
13 | | - }); |
14 | | - } |
| 3 | +// export function register() { |
| 4 | +// if (process.env.NEXT_RUNTIME === 'nodejs') { |
| 5 | +// Sentry.init({ |
| 6 | +// dsn: process.env.SENTRY_DSN, |
| 7 | +// tracesSampleRate: 1, |
| 8 | +// enableLogs: true, |
| 9 | +// debug: false, |
| 10 | +// environment: process.env.NODE_ENV === 'development' ? 'development' : undefined, |
| 11 | +// spotlight: process.env.NODE_ENV === 'development', |
| 12 | +// integrations: [Sentry.consoleLoggingIntegration()], |
| 13 | +// }); |
| 14 | +// } |
15 | 15 |
|
16 | | - if (process.env.NEXT_RUNTIME === 'edge') { |
17 | | - Sentry.init({ |
18 | | - dsn: process.env.SENTRY_DSN, |
19 | | - tracesSampleRate: 1, |
20 | | - enableLogs: true, |
21 | | - debug: false, |
22 | | - environment: process.env.NODE_ENV === 'development' ? 'development' : undefined, |
23 | | - integrations: [Sentry.consoleLoggingIntegration()], |
24 | | - // temporary change for investigating edge middleware tx names |
25 | | - beforeSendTransaction(event) { |
26 | | - if ( |
27 | | - event.transaction?.includes('middleware GET') && |
28 | | - event.contexts?.trace?.data |
29 | | - ) { |
30 | | - event.contexts.trace.data = { |
31 | | - ...event.contexts.trace.data, |
32 | | - 'sentry.source': 'custom', |
33 | | - }; |
34 | | - } |
35 | | - return event; |
36 | | - }, |
37 | | - }); |
38 | | - } |
39 | | -} |
| 16 | +// if (process.env.NEXT_RUNTIME === 'edge') { |
| 17 | +// Sentry.init({ |
| 18 | +// dsn: process.env.SENTRY_DSN, |
| 19 | +// tracesSampleRate: 1, |
| 20 | +// enableLogs: true, |
| 21 | +// debug: false, |
| 22 | +// environment: process.env.NODE_ENV === 'development' ? 'development' : undefined, |
| 23 | +// integrations: [Sentry.consoleLoggingIntegration()], |
| 24 | +// // temporary change for investigating edge middleware tx names |
| 25 | +// beforeSendTransaction(event) { |
| 26 | +// if ( |
| 27 | +// event.transaction?.includes('middleware GET') && |
| 28 | +// event.contexts?.trace?.data |
| 29 | +// ) { |
| 30 | +// event.contexts.trace.data = { |
| 31 | +// ...event.contexts.trace.data, |
| 32 | +// 'sentry.source': 'custom', |
| 33 | +// }; |
| 34 | +// } |
| 35 | +// return event; |
| 36 | +// }, |
| 37 | +// }); |
| 38 | +// } |
| 39 | +// } |
40 | 40 |
|
41 | | -export const onRequestError = Sentry.captureRequestError; |
| 41 | +// export const onRequestError = Sentry.captureRequestError; |
0 commit comments