sentry.server.config.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // This file configures the initialization of Sentry on the server.
  2. // The config you add here will be used whenever the server handles a request.
  3. // https://docs.sentry.io/platforms/javascript/guides/nextjs/
  4. import * as Sentry from '@sentry/nextjs'
  5. Sentry.init({
  6. dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
  7. ...(process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT && {
  8. environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT,
  9. }),
  10. // Setting this option to true will print useful information to the console while you're setting up Sentry.
  11. debug: false,
  12. // Enable performance monitoring
  13. tracesSampleRate: 0.02,
  14. ignoreErrors: [
  15. 'ResizeObserver',
  16. 'Failed to load Stripe.js',
  17. // Next.js internals — not actual errors
  18. 'NEXT_NOT_FOUND',
  19. 'NEXT_REDIRECT',
  20. // Network / infrastructure
  21. /504 Gateway Time-out/,
  22. 'Network request failed',
  23. 'Failed to fetch',
  24. 'AbortError',
  25. // Code-split loading failures
  26. 'ChunkLoadError',
  27. /Loading chunk [\d]+ failed/,
  28. // React hydration mismatches caused by extensions modifying DOM before hydration
  29. /text content does not match/i,
  30. /There was an error while hydrating/i,
  31. ],
  32. })