|
@@ -1,11 +1,10 @@
|
|
|
import {browserHistory, createRoutes, match} from 'react-router';
|
|
|
import {ExtraErrorData} from '@sentry/integrations';
|
|
|
import * as Sentry from '@sentry/react';
|
|
|
-import SentryRRWeb from '@sentry/rrweb';
|
|
|
import {Integrations} from '@sentry/tracing';
|
|
|
import {_browserPerformanceTimeOriginMode} from '@sentry/utils';
|
|
|
|
|
|
-import {DISABLE_RR_WEB, SENTRY_RELEASE_VERSION, SPA_DSN} from 'sentry/constants';
|
|
|
+import {SENTRY_RELEASE_VERSION, SPA_DSN} from 'sentry/constants';
|
|
|
import {Config} from 'sentry/types';
|
|
|
import {
|
|
|
initializeMeasureAssetsTimeout,
|
|
@@ -25,11 +24,7 @@ const SPA_MODE_ALLOW_URLS = [
|
|
|
* having routing instrumentation in order to have a smaller bundle size.
|
|
|
* (e.g. `static/views/integrationPipeline`)
|
|
|
*/
|
|
|
-function getSentryIntegrations(
|
|
|
- sentryConfig: Config['sentryConfig'],
|
|
|
- hasReplays: boolean = false,
|
|
|
- routes?: Function
|
|
|
-) {
|
|
|
+function getSentryIntegrations(sentryConfig: Config['sentryConfig'], routes?: Function) {
|
|
|
const extraTracingOrigins = SPA_DSN
|
|
|
? SPA_MODE_ALLOW_URLS
|
|
|
: [...sentryConfig?.whitelistUrls];
|
|
@@ -59,19 +54,7 @@ function getSentryIntegrations(
|
|
|
...partialTracingOptions,
|
|
|
}),
|
|
|
];
|
|
|
- if (hasReplays) {
|
|
|
- // eslint-disable-next-line no-console
|
|
|
- console.log('[sentry] Instrumenting session with rrweb');
|
|
|
|
|
|
- // TODO(ts): The type returned by SentryRRWeb seems to be somewhat
|
|
|
- // incompatible. It's a newer plugin, so this can be expected, but we
|
|
|
- // should fix.
|
|
|
- integrations.push(
|
|
|
- new SentryRRWeb({
|
|
|
- checkoutEveryNms: 60 * 1000, // 60 seconds
|
|
|
- }) as any
|
|
|
- );
|
|
|
- }
|
|
|
return integrations;
|
|
|
}
|
|
|
|
|
@@ -85,8 +68,6 @@ export function initializeSdk(config: Config, {routes}: {routes?: Function} = {}
|
|
|
const {apmSampling, sentryConfig, userIdentity} = config;
|
|
|
const tracesSampleRate = apmSampling ?? 0;
|
|
|
|
|
|
- const hasReplays = userIdentity?.isStaff && !DISABLE_RR_WEB;
|
|
|
-
|
|
|
Sentry.init({
|
|
|
...sentryConfig,
|
|
|
/**
|
|
@@ -101,7 +82,7 @@ export function initializeSdk(config: Config, {routes}: {routes?: Function} = {}
|
|
|
*/
|
|
|
release: SENTRY_RELEASE_VERSION ?? sentryConfig?.release,
|
|
|
allowUrls: SPA_DSN ? SPA_MODE_ALLOW_URLS : sentryConfig?.whitelistUrls,
|
|
|
- integrations: getSentryIntegrations(sentryConfig, hasReplays, routes),
|
|
|
+ integrations: getSentryIntegrations(sentryConfig, routes),
|
|
|
tracesSampleRate,
|
|
|
/**
|
|
|
* There is a bug in Safari, that causes `AbortError` when fetch is
|
|
@@ -129,7 +110,6 @@ export function initializeSdk(config: Config, {routes}: {routes?: Function} = {}
|
|
|
if (window.__SENTRY__VERSION) {
|
|
|
Sentry.setTag('sentry_version', window.__SENTRY__VERSION);
|
|
|
}
|
|
|
- Sentry.setTag('rrweb.active', hasReplays ? 'yes' : 'no');
|
|
|
|
|
|
LongTaskObserver.startPerformanceObserver();
|
|
|
initializeMeasureAssetsTimeout();
|