-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstrumentation.ts
45 lines (36 loc) · 1.42 KB
/
instrumentation.ts
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
import { captureConsoleIntegration, init } from '@sentry/nextjs';
import { env } from '@/app/lib/env';
export function register() {
if (process.env['NEXT_RUNTIME'] === 'nodejs') {
// this is your Sentry.init call from `sentry.server.config.js|ts`
const integrations = [];
if (process.env.NODE_ENV !== 'development') {
integrations.push(captureConsoleIntegration());
}
init({
dsn: env.SENTRY_DSN,
// Adjust this value in production, or use tracesSampler for greater control
tracesSampleRate: 1,
// Setting this option to true will print useful information to the console while you're setting up Sentry.
debug: false,
// uncomment the line below to enable Spotlight (https://spotlightjs.com)
// spotlight: process.env.NODE_ENV === 'development',
integrations: integrations,
});
}
// This is your Sentry.init call from `sentry.edge.config.js|ts`
if (process.env['NEXT_RUNTIME'] === 'edge') {
const integrations = [];
if (process.env.NODE_ENV !== 'development') {
integrations.push(captureConsoleIntegration());
}
init({
dsn: env.SENTRY_DSN,
// Adjust this value in production, or use tracesSampler for greater control
tracesSampleRate: 1,
// Setting this option to true will print useful information to the console while you're setting up Sentry.
debug: false,
integrations: integrations,
});
}
}