forked from runtipi/runtipi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sentry.server.config.ts
23 lines (20 loc) · 905 Bytes
/
sentry.server.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// This file configures the initialization of Sentry on the server.
// The config you add here will be used whenever the server handles a request.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
import * as Sentry from '@sentry/nextjs';
import { TipiConfig } from '@/server/core/TipiConfig';
import { cleanseErrorData } from '@runtipi/shared';
import { extraErrorDataIntegration } from '@sentry/integrations';
const { version, allowErrorMonitoring, NODE_ENV } = TipiConfig.getConfig();
if (allowErrorMonitoring && NODE_ENV === 'production' && process.env.LOCAL !== 'true') {
Sentry.init({
release: version,
environment: NODE_ENV,
dsn: 'https://7a73d72f886948478b55621e7b92c3c7@o4504242900238336.ingest.sentry.io/4504826587971584',
beforeSend: cleanseErrorData,
integrations: [extraErrorDataIntegration()],
initialScope: {
tags: { version },
},
});
}