-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsentry.server.config.ts
More file actions
63 lines (55 loc) · 1.45 KB
/
Copy pathsentry.server.config.ts
File metadata and controls
63 lines (55 loc) · 1.45 KB
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
53
54
55
56
57
58
59
60
61
62
63
import * as Sentry from '@sentry/nextjs'
import packageJson from './package.json'
const SENTRY_DSN = process.env.SENTRY_DSN
Sentry.init({
dsn: SENTRY_DSN,
environment: process.env.NODE_ENV,
debug: process.env.NODE_ENV === 'development',
tracesSampleRate: 1.0,
profilesSampleRate: 1.0,
sendDefaultPii: false,
release: `retroloop@${packageJson.version}`,
integrations: [
Sentry.prismaIntegration(),
Sentry.httpIntegration(),
Sentry.extraErrorDataIntegration({
depth: 10,
}),
Sentry.consoleIntegration({
levels: ['error', 'warn'],
}),
Sentry.modulesIntegration(),
Sentry.contextLinesIntegration(),
Sentry.localVariablesIntegration({
captureAllExceptions: false,
}),
],
beforeSend(event) {
if (process.env.NODE_ENV === 'production') {
if (
event.exception?.values?.[0]?.value?.includes('AbortError') ||
event.exception?.values?.[0]?.value?.includes('NetworkError') ||
event.exception?.values?.[0]?.value?.includes('Hydration')
) {
return null
}
}
return event
},
beforeSendTransaction(transaction) {
if (
transaction.transaction?.includes('/api/health') ||
transaction.transaction?.includes('/_next/static')
) {
return null
}
return transaction
},
initialScope: {
tags: {
component: 'server',
runtime: 'nodejs',
},
},
spotlight: process.env.NODE_ENV === 'development',
})