-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsentry.edge.config.ts
More file actions
50 lines (43 loc) · 1.04 KB
/
Copy pathsentry.edge.config.ts
File metadata and controls
50 lines (43 loc) · 1.04 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
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,
sendDefaultPii: false,
release: `retroloop@${packageJson.version}`,
integrations: [
Sentry.httpIntegration(),
Sentry.extraErrorDataIntegration({
depth: 5,
}),
],
beforeSend(event) {
if (process.env.NODE_ENV === 'production') {
if (
event.exception?.values?.[0]?.value?.includes('AbortError') ||
event.exception?.values?.[0]?.value?.includes('NetworkError')
) {
return null
}
}
return event
},
beforeSendTransaction(transaction) {
if (
transaction.transaction?.includes('/api/health') ||
transaction.transaction?.includes('/_next/static')
) {
return null
}
return transaction
},
initialScope: {
tags: {
component: 'edge',
runtime: 'edge',
},
},
})