Skip to content

Commit

Permalink
chore: Make it possible to opt out from Sentry in the dogfood browser… (
Browse files Browse the repository at this point in the history
#730)

… app
  • Loading branch information
szuperaz authored Jun 28, 2023
1 parent d1096b4 commit afd22b7
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions packages/react-dogfood/sentry.client.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@ import * as Sentry from '@sentry/nextjs';

const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN;

Sentry.init({
dsn: SENTRY_DSN, // ||'https://[email protected]/4504044576374784',
// Adjust this value in production, or use tracesSampler for greater control
tracesSampleRate: 1.0,
// ...
// Note: if you want to override the automatic release value, do not set a
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
// that it will also get attached to your source maps
});
if (window.location.href.includes('no-trace')) {
console.log('Opting out from Sentry');
} else {
console.log('Setting up Sentry');

Sentry.init({
dsn: SENTRY_DSN, // ||'https://[email protected]/4504044576374784',
// Adjust this value in production, or use tracesSampler for greater control
tracesSampleRate: 1.0,
// ...
// Note: if you want to override the automatic release value, do not set a
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
// that it will also get attached to your source maps
});
}

0 comments on commit afd22b7

Please sign in to comment.