Skip to content

Commit 6b8709e

Browse files
committed
Sentry only on prod
1 parent def3137 commit 6b8709e

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

next.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,11 @@ module.exports = (phase, args) =>
6868
// https://docs.sentry.io/product/crons/
6969
// https://vercel.com/docs/cron-jobs
7070
automaticVercelMonitors: true,
71+
72+
sourcemaps: {
73+
disable: process.env.VERCEL_ENV !== 'production',
74+
},
75+
release: {
76+
create: process.env.VERCEL_ENV === 'production',
77+
},
7178
});

sentry.edge.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
import * as Sentry from '@sentry/nextjs';
77

88
Sentry.init({
9-
dsn: 'https://a8f2aec35998f8b8f4f0cafd73e3951d@o4504918397353984.ingest.us.sentry.io/4509436341518336',
9+
// Kept in an environment variable to only enable in prod
10+
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
1011

1112
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
1213
tracesSampleRate: 1,

sentry.server.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
import * as Sentry from '@sentry/nextjs';
66

77
Sentry.init({
8-
dsn: 'https://a8f2aec35998f8b8f4f0cafd73e3951d@o4504918397353984.ingest.us.sentry.io/4509436341518336',
8+
// Kept in an environment variable to only enable in prod
9+
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
910

1011
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
1112
tracesSampleRate: 1,

src/instrumentation-client.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
import * as Sentry from '@sentry/nextjs';
66

77
Sentry.init({
8-
dsn: 'https://a8f2aec35998f8b8f4f0cafd73e3951d@o4504918397353984.ingest.us.sentry.io/4509436341518336',
8+
// Kept in an environment variable to only enable in prod
9+
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
910

1011
// Add optional integrations for additional features
1112
integrations: [

0 commit comments

Comments
 (0)