-
-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathinstrumentation-client.ts
More file actions
27 lines (26 loc) · 960 Bytes
/
instrumentation-client.ts
File metadata and controls
27 lines (26 loc) · 960 Bytes
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
import * as Sentry from "@sentry/nextjs"
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
// Adds request headers and IP for users
allowUrls: [/https?:\/\/((www)\.)?geekskai\.com/],
sendDefaultPii: true,
// Capture 100% in dev, 10% in production
// Adjust based on your traffic volume
tracesSampleRate: process.env.NODE_ENV === "development" ? 1.0 : 1.0,
integrations: [
Sentry.replayIntegration({
// 关闭默认的“所有文本都打星号”
maskAllText: false,
// 如果希望图片/视频也正常显示,可以一起关掉
blockAllMedia: false,
}),
],
// Capture Replay for 10% of all sessions,
// plus for 100% of sessions with an error
replaysSessionSampleRate: 0.5,
replaysOnErrorSampleRate: 1.0,
// Enable logs to be sent to Sentry
enableLogs: true,
})
// This export will instrument router navigations
export const onRouterTransitionStart = Sentry.captureRouterTransitionStart