diff --git a/src/index.js b/src/index.js index dc1cf1956..ec9e35e9c 100644 --- a/src/index.js +++ b/src/index.js @@ -38,17 +38,25 @@ Sentry.init({ dsn: SENTRY_DSN, environment: TERRASO_ENV, integrations: [ - new Sentry.BrowserTracing({ - // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled - tracePropagationTargets: ['localhost', /^https:\/\/yourserver\.io\/api/], + // See docs for support of different versions of variation of react router + // https://docs.sentry.io/platforms/javascript/guides/react/configuration/integrations/react-router/ + Sentry.reactRouterV6BrowserTracingIntegration({ + useEffect: React.useEffect, }), - new Sentry.Replay(), + Sentry.replayIntegration(), ], - // Performance Monitoring - tracesSampleRate: 1.0, // Capture 100% of the transactions - // Session Replay - replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production. - replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur. + + // Set tracesSampleRate to 1.0 to capture 100% + // of transactions for performance monitoring. + tracesSampleRate: 1.0, + + // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled + tracePropagationTargets: ['127.0.0.1', /^https:\/\/terraso\.org/], + + // Capture Replay for 10% of all sessions, + // plus for 100% of sessions with an error + replaysSessionSampleRate: 0.1, + replaysOnErrorSampleRate: 1.0, }); createRoot(document.getElementById('root')).render(