From ac642ea6972c5eeb3003cc390951c700d6e00617 Mon Sep 17 00:00:00 2001 From: Matchu Date: Mon, 15 Aug 2022 18:12:19 -0700 Subject: [PATCH] Filter out browser extensions from error logging Been getting a lot of errors I *think* from folks trying to add OWLS Pricer to Impress 2020 even though it doesn't work here! Reasonable to have happen though! I thought Sentry knew to ignore those, but I guess it doesn't? In this change, we add some filtering to ignore errors triggered by extensions. This should keep them out of our inbox! I wasn't able to test this very robustly locally. I'm mostly just crossing fingers! --- src/app/App.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/app/App.js b/src/app/App.js index 72c802f..d131ab3 100644 --- a/src/app/App.js +++ b/src/app/App.js @@ -98,6 +98,16 @@ Sentry.init({ startTransactionOnLocationChange: false, }), ], + denyUrls: [ + // Don't log errors that were probably triggered by extensions and not by + // our own app. (Apparently Sentry's setting to ignore browser extension + // errors doesn't do this anywhere near as consistently as I'd expect?) + // + // Adapted from https://gist.github.com/impressiver/5092952, as linked in + // https://docs.sentry.io/platforms/javascript/configuration/filtering/. + /^chrome-extension:\/\//, + /^moz-extension:\/\//, + ], // Since we're only tracking first-page loads and not navigations, 100% // sampling isn't actually so much! Tune down if it becomes a problem, tho.