diff --git a/static/app/constants/sdk.ts b/static/app/constants/sdk.ts index 9fb862a35fb3..f4bf829fc30c 100644 --- a/static/app/constants/sdk.ts +++ b/static/app/constants/sdk.ts @@ -14,6 +14,22 @@ export const IGNORED_SPAN_NAMES = ['amplitude.com', 'pendo.io', 'reload.getsentr // pollute our breadcrumbs since they may occur a LOT. // // XXX(epurkhiser): Note some of these hosts may only apply to sentry.io. +/** + * Deny errors originating from browser extensions. These are third-party + * scripts injected into Sentry pages and are not actionable by us. + * See: https://docs.sentry.io/platforms/javascript/configuration/filtering/#decluttering-sentry + */ +export const IGNORED_ERROR_DENY_URLS = [ + // Chrome and generic extension paths (e.g. /extensions/google/setup/) + /extensions\//i, + // Chrome extension protocol + /^chrome-extension:\/\//i, + // Firefox extension protocol + /^moz-extension:\/\//i, + // Safari extension protocol + /^safari-extension:\/\//i, +]; + export const SPA_MODE_ALLOW_URLS = [ 'localhost', 'dev.getsentry.net', diff --git a/static/app/serviceWorker/worker/initializeSentry.ts b/static/app/serviceWorker/worker/initializeSentry.ts index d01abdf6b3ff..05e1790c8b2e 100644 --- a/static/app/serviceWorker/worker/initializeSentry.ts +++ b/static/app/serviceWorker/worker/initializeSentry.ts @@ -3,6 +3,7 @@ import type {Breadcrumb} from '@sentry/browser'; import { IGNORED_BREADCRUMB_FETCH_HOSTS, + IGNORED_ERROR_DENY_URLS, IGNORED_SPAN_NAMES, SENTRY_RELEASE_VERSION, SPA_DSN, @@ -36,6 +37,7 @@ export function initializeSentry({ isInitialized = true; Sentry.init({ allowUrls: SPA_DSN ? SPA_MODE_ALLOW_URLS : sentryConfig.allowUrls, + denyUrls: IGNORED_ERROR_DENY_URLS, dsn: SPA_DSN || dsn, release: SENTRY_RELEASE_VERSION ?? sentryConfig.release, environment: sentryConfig.environment,