-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsentry.ts
35 lines (30 loc) · 1.02 KB
/
sentry.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import * as Sentry from '@sentry/react';
/**
* Init sentry
*/
function InitSentry() {
// https://docs.sentry.io/platforms/javascript/guides/react/
Sentry.init({
// https://develop.sentry.dev/sdk/overview/
// config your sentry
// eslint-disable-next-line no-undef
dsn: $__SENTRY__DSN__$, // 'https://[email protected]/0'
integrations: [
Sentry.browserTracingIntegration({
// disable automatic span creation
instrumentNavigation: false,
instrumentPageLoad: false,
}),
],
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for tracing.
tracesSampleRate: 1.0,
// Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled
tracePropagationTargets: [/^\//, /^https:\/\/yourserver\.io\/api/],
// Capture Replay for 10% of all sessions,
// plus for 100% of sessions with an error
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
});
}
export default InitSentry;