-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sentry): conditionally init sentry
- Loading branch information
Showing
1 changed file
with
24 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,29 +31,31 @@ import isStagingEnvironment from "./features/isStagingEnvironment"; | |
const SentryRoute = Sentry.withSentryRouting(Route); | ||
const history = createBrowserHistory(); | ||
|
||
Sentry.init({ | ||
dsn: "https://[email protected]/4506320026664960", | ||
integrations: [ | ||
new Sentry.BrowserTracing({ | ||
routingInstrumentation: Sentry.reactRouterV5Instrumentation(history), | ||
}), | ||
], | ||
environment: _env_.REACT_APP_ENVIRONMENT, | ||
// trace all staging and locale traces and 70% of production traces | ||
tracesSampleRate: isStagingEnvironment() ? 1.0 : 0.7, | ||
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled | ||
tracePropagationTargets: [ | ||
"localhost", | ||
/^https:\/\/dev\.tryber\.me\/api/, | ||
/^https:\/\/tryber\.me\/api/, | ||
], | ||
if (process.env.NODE_ENV !== "test") { | ||
Sentry.init({ | ||
dsn: "https://[email protected]/4506320026664960", | ||
integrations: [ | ||
new Sentry.BrowserTracing({ | ||
routingInstrumentation: Sentry.reactRouterV5Instrumentation(history), | ||
}), | ||
], | ||
environment: _env_.REACT_APP_ENVIRONMENT, | ||
// trace all staging and locale traces and 70% of production traces | ||
tracesSampleRate: isStagingEnvironment() ? 1.0 : 0.7, | ||
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled | ||
tracePropagationTargets: [ | ||
"localhost", | ||
/^https:\/\/dev\.tryber\.me\/api/, | ||
/^https:\/\/tryber\.me\/api/, | ||
], | ||
|
||
// Capture Replay for 10% of all sessions, | ||
// plus for 100% of sessions with an error | ||
// do not capture for staging and locale | ||
replaysSessionSampleRate: isStagingEnvironment() ? 0.0 : 0.1, | ||
replaysOnErrorSampleRate: isStagingEnvironment() ? 0.0 : 1.0, | ||
}); | ||
// Capture Replay for 10% of all sessions, | ||
// plus for 100% of sessions with an error | ||
// do not capture for staging and locale | ||
replaysSessionSampleRate: isStagingEnvironment() ? 0.0 : 0.1, | ||
replaysOnErrorSampleRate: isStagingEnvironment() ? 0.0 : 1.0, | ||
}); | ||
} | ||
|
||
function App() { | ||
return ( | ||
|