-
Notifications
You must be signed in to change notification settings - Fork 128
/
sentry.default.config.js
52 lines (49 loc) · 1.49 KB
/
sentry.default.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
const filters = [
// Hyperlane custom set
"trap returned falsish for property", // Error from cosmos wallet lib
"not established yet", // Same, bug with their WC integration ^
"Refused to create a WebAssembly object", // CSP blocking wasm
"call to WebAssembly.instantiate", // Same ^
"Request rejected", // Unknown noise during Next.js init
"WebSocket connection failed for host", // WalletConnect flakiness
"Socket stalled when trying to connect", // Same ^
"Request expired. Please try again.", // Same^
"Failed to publish payload", // Same ^
// Some recommendations from https://docs.sentry.io/platforms/javascript/configuration/filtering
"top.GLOBALS",
"originalCreateNotification",
"canvas.contentDocument",
"MyApp_RemoveAllHighlights",
"atomicFindClose",
]
export const sentryDefaultConfig = {
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
tracesSampleRate: 0.01,
maxBreadcrumbs: 1,
sendClientReports: false,
attachStacktrace: false,
defaultIntegrations: false,
integrations: [],
beforeSend(event, hint) {
if (event && event.message &&
filters.find((f) => event.message.match(f)))
{
return null;
}
const error = hint.originalException;
if (error && error.message &&
filters.find((f) => error.message.match(f)))
{
return null;
}
delete event.user;
return event;
},
ignoreErrors: filters,
denyUrls: [
// Chrome extensions
/extensions\//i,
/^chrome:\/\//i,
/^chrome-extension:\/\//i,
],
};