-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsentry.server.config.ts
More file actions
34 lines (30 loc) · 1.07 KB
/
sentry.server.config.ts
File metadata and controls
34 lines (30 loc) · 1.07 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
import { loadServerConfig } from "@/config/loadServerConfig";
import { PrismaInstrumentation } from "@prisma/instrumentation";
import * as Sentry from "@sentry/nextjs";
const sentryConfig = loadServerConfig().sentryConfig;
console.log("Initializing Sentry on server, using DSN:", sentryConfig.dsn);
if (!sentryConfig.isEnabled) {
// eslint-disable-next-line no-console
console.warn("⚠️ WARNING: SENTRY IS NOT ENABLED! ⚠️");
}
Sentry.init({
enabled: sentryConfig.isEnabled,
dsn: sentryConfig.dsn,
debug: sentryConfig.debug,
release: sentryConfig.release,
environment: sentryConfig.environment,
integrations: [
Sentry.anrIntegration({
anrThreshold: sentryConfig.anrThreshold,
captureStackTrace: true,
}),
Sentry.extraErrorDataIntegration(),
Sentry.prismaIntegration({
prismaInstrumentation: new PrismaInstrumentation(),
}),
],
attachStacktrace: sentryConfig.attachStacktrace,
sampleRate: sentryConfig.sampleRate,
tracesSampleRate: sentryConfig.tracesSampleRate,
profilesSampleRate: sentryConfig.profilesSampleRate,
});