sentry.edge.config.ts 941 B

1234567891011121314151617181920212223242526
  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. import * as Sentry from '@sentry/nextjs'
  6. Sentry.init({
  7. dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
  8. ...(process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT && {
  9. environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT,
  10. }),
  11. // Setting this option to true will print useful information to the console while you're setting up Sentry.
  12. debug: false,
  13. // Enable performance monitoring
  14. tracesSampleRate: 0.02,
  15. ignoreErrors: [
  16. 'NEXT_NOT_FOUND',
  17. 'NEXT_REDIRECT',
  18. /504 Gateway Time-out/,
  19. 'Network request failed',
  20. 'Failed to fetch',
  21. 'AbortError',
  22. ],
  23. })