diff --git a/apps/app/sentry.edge.config.ts b/apps/app/sentry.edge.config.ts index e996f794ca..991de81ebd 100644 --- a/apps/app/sentry.edge.config.ts +++ b/apps/app/sentry.edge.config.ts @@ -10,6 +10,11 @@ Sentry.init({ process.env.SENTRY_DSN ?? 'https://331f1c3d4b08e9352dd1a2621e1ae845@o4509214247813120.ingest.us.sentry.io/4511304630927360', + // Only report from production. On Vercel, VERCEL_ENV is 'production' | 'preview' + // | 'development'; on any non-production deployment (or if the var is missing) + // Sentry stays disabled — a no-op, never an error — to avoid noise and quota burn. + enabled: process.env.VERCEL_ENV === 'production', + tracesSampleRate: process.env.NODE_ENV === 'development' ? 1.0 : 0.1, enableLogs: true, diff --git a/apps/app/sentry.server.config.ts b/apps/app/sentry.server.config.ts index 6d9894dbca..f2d422f573 100644 --- a/apps/app/sentry.server.config.ts +++ b/apps/app/sentry.server.config.ts @@ -9,6 +9,11 @@ Sentry.init({ process.env.SENTRY_DSN ?? 'https://331f1c3d4b08e9352dd1a2621e1ae845@o4509214247813120.ingest.us.sentry.io/4511304630927360', + // Only report from production. On Vercel, VERCEL_ENV is 'production' | 'preview' + // | 'development'; on any non-production deployment (or if the var is missing) + // Sentry stays disabled — a no-op, never an error — to avoid noise and quota burn. + enabled: process.env.VERCEL_ENV === 'production', + tracesSampleRate: process.env.NODE_ENV === 'development' ? 1.0 : 0.1, // Off in production: local variables in stack frames can expose request-scoped diff --git a/apps/app/src/instrumentation-client.ts b/apps/app/src/instrumentation-client.ts index cd27359c8f..9f60393d4b 100644 --- a/apps/app/src/instrumentation-client.ts +++ b/apps/app/src/instrumentation-client.ts @@ -14,6 +14,11 @@ Sentry.init({ process.env.NEXT_PUBLIC_SENTRY_DSN ?? 'https://331f1c3d4b08e9352dd1a2621e1ae845@o4509214247813120.ingest.us.sentry.io/4511304630927360', + // Only report from production. NEXT_PUBLIC_VERCEL_ENV is inlined at build time + // per Vercel deployment; preview/dev builds (or a missing var) keep Sentry + // disabled — a no-op, never an error — to avoid noise and quota burn. + enabled: process.env.NEXT_PUBLIC_VERCEL_ENV === 'production', + integrations: [ // Add `data-sentry-mask` (or `.sentry-mask`) to any element rendering // customer-confidential data; `data-sentry-block` to drop whole sections. diff --git a/apps/portal/sentry.edge.config.ts b/apps/portal/sentry.edge.config.ts index e996f794ca..991de81ebd 100644 --- a/apps/portal/sentry.edge.config.ts +++ b/apps/portal/sentry.edge.config.ts @@ -10,6 +10,11 @@ Sentry.init({ process.env.SENTRY_DSN ?? 'https://331f1c3d4b08e9352dd1a2621e1ae845@o4509214247813120.ingest.us.sentry.io/4511304630927360', + // Only report from production. On Vercel, VERCEL_ENV is 'production' | 'preview' + // | 'development'; on any non-production deployment (or if the var is missing) + // Sentry stays disabled — a no-op, never an error — to avoid noise and quota burn. + enabled: process.env.VERCEL_ENV === 'production', + tracesSampleRate: process.env.NODE_ENV === 'development' ? 1.0 : 0.1, enableLogs: true, diff --git a/apps/portal/sentry.server.config.ts b/apps/portal/sentry.server.config.ts index 6d9894dbca..f2d422f573 100644 --- a/apps/portal/sentry.server.config.ts +++ b/apps/portal/sentry.server.config.ts @@ -9,6 +9,11 @@ Sentry.init({ process.env.SENTRY_DSN ?? 'https://331f1c3d4b08e9352dd1a2621e1ae845@o4509214247813120.ingest.us.sentry.io/4511304630927360', + // Only report from production. On Vercel, VERCEL_ENV is 'production' | 'preview' + // | 'development'; on any non-production deployment (or if the var is missing) + // Sentry stays disabled — a no-op, never an error — to avoid noise and quota burn. + enabled: process.env.VERCEL_ENV === 'production', + tracesSampleRate: process.env.NODE_ENV === 'development' ? 1.0 : 0.1, // Off in production: local variables in stack frames can expose request-scoped diff --git a/apps/portal/src/instrumentation-client.ts b/apps/portal/src/instrumentation-client.ts index c265121a9b..06a44c55fd 100644 --- a/apps/portal/src/instrumentation-client.ts +++ b/apps/portal/src/instrumentation-client.ts @@ -9,6 +9,11 @@ Sentry.init({ process.env.NEXT_PUBLIC_SENTRY_DSN ?? 'https://331f1c3d4b08e9352dd1a2621e1ae845@o4509214247813120.ingest.us.sentry.io/4511304630927360', + // Only report from production. NEXT_PUBLIC_VERCEL_ENV is inlined at build time + // per Vercel deployment; preview/dev builds (or a missing var) keep Sentry + // disabled — a no-op, never an error — to avoid noise and quota burn. + enabled: process.env.NEXT_PUBLIC_VERCEL_ENV === 'production', + integrations: [ // Add `data-sentry-mask` (or `.sentry-mask`) to any element rendering // customer-confidential data; `data-sentry-block` to drop whole sections.