diff --git a/frontend/src/ts/sentry.ts b/frontend/src/ts/sentry.ts index 74b9a32c2..681c8ef81 100644 --- a/frontend/src/ts/sentry.ts +++ b/frontend/src/ts/sentry.ts @@ -11,6 +11,16 @@ export function init(): void { integrations: [ Sentry.browserTracingIntegration(), Sentry.replayIntegration(), + Sentry.thirdPartyErrorFilterIntegration({ + filterKeys: ["monkeytype-frontend"], + // Defines how to handle errors that contain third party stack frames. + // Possible values are: + // - 'drop-error-if-contains-third-party-frames' + // - 'drop-error-if-exclusively-contains-third-party-frames' + // - 'apply-tag-if-contains-third-party-frames' + // - 'apply-tag-if-exclusively-contains-third-party-frames' + behaviour: "drop-error-if-contains-third-party-frames", + }), ], // Tracing tracesSampleRate: 1.0, // Capture 100% of the transactions @@ -19,6 +29,20 @@ export function init(): void { // Session Replay replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production. replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur. + allowUrls: ["https://*.monkeytype.com"], + ignoreErrors: [ + /** + * Thrown when firefox prevents an add-on from refrencing a DOM element that has been removed. + * This can also be filtered by enabling the browser extension inbound filter + */ + "TypeError: can't access dead object", + /** + * React internal error thrown when something outside react modifies the DOM + * This is usually because of a browser extension or Chrome's built-in translate + */ + "NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.", + "NotFoundError: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.", + ], }); } diff --git a/frontend/vite.config.prod.js b/frontend/vite.config.prod.js index 0652eaa9f..b05abbdf9 100644 --- a/frontend/vite.config.prod.js +++ b/frontend/vite.config.prod.js @@ -148,6 +148,7 @@ export default { release: { name: buildClientVersion(), }, + applicationKey: "monkeytype-frontend", }), replace([ {