Skip to content

Commit 2fc4d42

Browse files
committed
chore: ignore third party errors in sentry
1 parent cbb7264 commit 2fc4d42

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

frontend/src/ts/sentry.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ export function init(): void {
1111
integrations: [
1212
Sentry.browserTracingIntegration(),
1313
Sentry.replayIntegration(),
14+
Sentry.thirdPartyErrorFilterIntegration({
15+
filterKeys: ["monkeytype-frontend"],
16+
// Defines how to handle errors that contain third party stack frames.
17+
// Possible values are:
18+
// - 'drop-error-if-contains-third-party-frames'
19+
// - 'drop-error-if-exclusively-contains-third-party-frames'
20+
// - 'apply-tag-if-contains-third-party-frames'
21+
// - 'apply-tag-if-exclusively-contains-third-party-frames'
22+
behaviour: "drop-error-if-contains-third-party-frames",
23+
}),
1424
],
1525
// Tracing
1626
tracesSampleRate: 1.0, // Capture 100% of the transactions
@@ -19,6 +29,20 @@ export function init(): void {
1929
// Session Replay
2030
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.
2131
replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
32+
allowUrls: ["https://*.monkeytype.com"],
33+
ignoreErrors: [
34+
/**
35+
* Thrown when firefox prevents an add-on from refrencing a DOM element that has been removed.
36+
* This can also be filtered by enabling the browser extension inbound filter
37+
*/
38+
"TypeError: can't access dead object",
39+
/**
40+
* React internal error thrown when something outside react modifies the DOM
41+
* This is usually because of a browser extension or Chrome's built-in translate
42+
*/
43+
"NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.",
44+
"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.",
45+
],
2246
});
2347
}
2448

frontend/vite.config.prod.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ export default {
148148
release: {
149149
name: buildClientVersion(),
150150
},
151+
applicationKey: "monkeytype-frontend",
151152
}),
152153
replace([
153154
{

0 commit comments

Comments
 (0)