From 65fb73ae82cb8552e94038a8680e673ec2c4cc7a Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Fri, 28 Feb 2025 15:14:56 -0800 Subject: [PATCH] IO-3162 Add Prod/Test restriction on sentry init. --- client/src/utils/sentry.js | 84 +++++++++++++++++++------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/client/src/utils/sentry.js b/client/src/utils/sentry.js index c6e4ae271..d1152d773 100644 --- a/client/src/utils/sentry.js +++ b/client/src/utils/sentry.js @@ -17,47 +17,47 @@ const currentDatePST = new Date() const sentryRelease = `${import.meta.env.VITE_APP_IS_TEST ? "test" : "production"}-${currentDatePST}-${process.env.VITE_GIT_COMMIT_HASH}`.trim(); -//if (import.meta.env.PROD) { -Sentry.init({ - dsn: InstanceRenderManager({ - imex: "https://fd7e89369b6b4bdc9c6c4c9f22fa4ee4@o492140.ingest.sentry.io/5651027", - rome: "https://a6acc91c073e414196014b8484627a61@o492140.ingest.sentry.io/4504561071161344" - }), - release: sentryRelease, - - ignoreErrors: [ - "ResizeObserver loop", - "ResizeObserver loop limit exceeded", - "Module specifier, 'fs' does not start", - "Module specifier, 'zlib' does not start with", - "Messaging: This browser doesn't support the API's required to use the Firebase SDK.", - "Failed to update a ServiceWorker for scope" - ], - integrations: [ - // 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, - useLocation, - useNavigationType, - createRoutesFromChildren, - matchRoutes +if (!import.meta.env.DEV) { + Sentry.init({ + dsn: InstanceRenderManager({ + imex: "https://fd7e89369b6b4bdc9c6c4c9f22fa4ee4@o492140.ingest.sentry.io/5651027", + rome: "https://a6acc91c073e414196014b8484627a61@o492140.ingest.sentry.io/4504561071161344" }), - Sentry.replayIntegration(), - Sentry.browserProfilingIntegration() - ], + release: sentryRelease, - tracePropagationTargets: [ - "api.imex.online", - "api.test.imex.online", - "db.imex.online", - "api.romeonline.io", - "api.test.romeonline.io", - "db.romeonline.io" - ], - tracesSampleRate: 1.0, - replaysOnErrorSampleRate: 1.0, - environment: import.meta.env.MODE, - beforeBreadcrumb: excludeGraphQLFetch -}); -//} + ignoreErrors: [ + "ResizeObserver loop", + "ResizeObserver loop limit exceeded", + "Module specifier, 'fs' does not start", + "Module specifier, 'zlib' does not start with", + "Messaging: This browser doesn't support the API's required to use the Firebase SDK.", + "Failed to update a ServiceWorker for scope" + ], + integrations: [ + // 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, + useLocation, + useNavigationType, + createRoutesFromChildren, + matchRoutes + }), + Sentry.replayIntegration(), + Sentry.browserProfilingIntegration() + ], + + tracePropagationTargets: [ + "api.imex.online", + "api.test.imex.online", + "db.imex.online", + "api.romeonline.io", + "api.test.romeonline.io", + "db.romeonline.io" + ], + tracesSampleRate: 1.0, + replaysOnErrorSampleRate: 1.0, + environment: import.meta.env.MODE, + beforeBreadcrumb: excludeGraphQLFetch + }); +}