sentry.edge.config.ts26 lines · main
| 1 | // This file configures the initialization of Sentry for edge features (middleware, edge routes, and so on). |
| 2 | // The config you add here will be used whenever one of the edge features is loaded. |
| 3 | // Note that this config is unrelated to the Vercel Edge Runtime and is also required when running locally. |
| 4 | // https://docs.sentry.io/platforms/javascript/guides/nextjs/ |
| 5 | |
| 6 | import * as Sentry from '@sentry/nextjs' |
| 7 | |
| 8 | Sentry.init({ |
| 9 | dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, |
| 10 | ...(process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT && { |
| 11 | environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT, |
| 12 | }), |
| 13 | // Setting this option to true will print useful information to the console while you're setting up Sentry. |
| 14 | debug: false, |
| 15 | |
| 16 | // Enable performance monitoring |
| 17 | tracesSampleRate: 0.02, |
| 18 | ignoreErrors: [ |
| 19 | 'NEXT_NOT_FOUND', |
| 20 | 'NEXT_REDIRECT', |
| 21 | /504 Gateway Time-out/, |
| 22 | 'Network request failed', |
| 23 | 'Failed to fetch', |
| 24 | 'AbortError', |
| 25 | ], |
| 26 | }) |