diff --git a/web/instrumentation-client.ts b/web/instrumentation-client.ts index 4ad38d0a..7a58933a 100644 --- a/web/instrumentation-client.ts +++ b/web/instrumentation-client.ts @@ -3,7 +3,7 @@ // https://docs.sentry.io/platforms/javascript/guides/nextjs/ import * as Sentry from '@sentry/nextjs' -import {SENTRY_DSN} from 'common/hosting/constants' +import {IS_LOCAL, SENTRY_DSN} from 'common/hosting/constants' const IS_NATIVE = !!process.env.NEXT_PUBLIC_WEBVIEW @@ -11,6 +11,8 @@ Sentry.init({ // Skip tunneling in native app context dsn: SENTRY_DSN, + enabled: !IS_LOCAL, + // Add optional integrations for additional features integrations: IS_NATIVE ? [] : [Sentry.replayIntegration()], diff --git a/web/sentry.edge.config.ts b/web/sentry.edge.config.ts index 71c95488..3736d7cf 100644 --- a/web/sentry.edge.config.ts +++ b/web/sentry.edge.config.ts @@ -4,11 +4,13 @@ // https://docs.sentry.io/platforms/javascript/guides/nextjs/ import * as Sentry from '@sentry/nextjs' -import {SENTRY_DSN} from 'common/hosting/constants' +import {IS_LOCAL, SENTRY_DSN} from 'common/hosting/constants' Sentry.init({ dsn: SENTRY_DSN, + enabled: !IS_LOCAL, + // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control. tracesSampleRate: 0.1, diff --git a/web/sentry.server.config.ts b/web/sentry.server.config.ts index 7c581d9f..714c61c6 100644 --- a/web/sentry.server.config.ts +++ b/web/sentry.server.config.ts @@ -3,11 +3,13 @@ // https://docs.sentry.io/platforms/javascript/guides/nextjs/ import * as Sentry from '@sentry/nextjs' -import {SENTRY_DSN} from 'common/hosting/constants' +import {IS_LOCAL, SENTRY_DSN} from 'common/hosting/constants' Sentry.init({ dsn: SENTRY_DSN, + enabled: !IS_LOCAL, + // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control. tracesSampleRate: 0.1,