From c0fcf7b9719fc6d93ceca8178f06cbea5dcfdb99 Mon Sep 17 00:00:00 2001 From: EnixCoda Date: Wed, 4 Mar 2020 00:30:55 +0800 Subject: [PATCH] fix: disable few sentry integrations --- src/analytics.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/analytics.ts b/src/analytics.ts index c186d8e..a0504ad 100644 --- a/src/analytics.ts +++ b/src/analytics.ts @@ -15,6 +15,12 @@ const errorSet = new Set([ 'Failed to fetch', // network fail in Chrome ]) +const disabledIntegrations: string[] = [ + 'TryCatch', + 'Breadcrumbs', + 'GlobalHandlers', + 'CaptureConsole', +] const sentryOptions: Sentry.BrowserOptions = { dsn: `https://${PUBLIC_KEY}@sentry.io/${PROJECT_ID}`, release: VERSION, @@ -22,7 +28,8 @@ const sentryOptions: Sentry.BrowserOptions = { // Not safe to activate all integrations in non-Chrome environments where Gitako may not run in top context // https://docs.sentry.io/platforms/javascript/#sdk-integrations defaultIntegrations: IN_PRODUCTION_MODE ? undefined : false, - integrations: integrations => integrations.filter(({ name }) => name !== 'TryCatch'), + integrations: integrations => + integrations.filter(({ name }) => !disabledIntegrations.includes(name)), beforeSend(event) { const message = event.exception?.values?.[0].value || event.message if (message) {