Skip to content

Commit 6913c26

Browse files
committed
fix: sentry controlplane auto-instrumentation
1 parent 6a783b9 commit 6913c26

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

controlplane/src/core/sentry.config.ts

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { fastifyIntegration } from '@sentry/node';
77

88
export interface SentryConfig {
99
sentry: {
10-
enabled: boolean;
1110
dsn?: string;
1211
eventLoopBlockIntegrationThresholdMs?: number;
1312
profileSessionSampleRate?: number;
@@ -19,28 +18,25 @@ export interface SentryConfig {
1918
}
2019

2120
export function init(opts: SentryConfig) {
22-
if (opts.sentry.enabled) {
23-
Sentry.init({
24-
dsn: opts.sentry.dsn,
25-
integrations: [
26-
fastifyIntegration(),
27-
eventLoopBlockIntegration({ threshold: opts.sentry.eventLoopBlockIntegrationThresholdMs }),
28-
nodeProfilingIntegration(),
29-
],
30-
profileSessionSampleRate: opts.sentry.profileSessionSampleRate,
31-
sendDefaultPii: opts.sentry.sendDefaultPii,
32-
tracesSampleRate: opts.sentry.tracesSampleRate,
33-
profileLifecycle: opts.sentry.profileLifecycle,
34-
enableLogs: opts.sentry.enableLogs,
35-
});
36-
console.log("Sentry is configured & initialized.");
37-
return Sentry;
38-
}
21+
Sentry.init({
22+
dsn: opts.sentry.dsn,
23+
integrations: [
24+
fastifyIntegration(),
25+
eventLoopBlockIntegration({threshold: opts.sentry.eventLoopBlockIntegrationThresholdMs}),
26+
nodeProfilingIntegration(),
27+
],
28+
profileSessionSampleRate: opts.sentry.profileSessionSampleRate,
29+
sendDefaultPii: opts.sentry.sendDefaultPii,
30+
tracesSampleRate: opts.sentry.tracesSampleRate,
31+
profileLifecycle: opts.sentry.profileLifecycle,
32+
enableLogs: opts.sentry.enableLogs,
33+
});
34+
console.log('Sentry is configured & initialized.');
35+
return Sentry;
3936
}
4037

4138
init({
4239
sentry: {
43-
enabled: true,
4440
dsn: process.env.SENTRY_DSN,
4541
tracesSampleRate: Number(process.env.SENTRY_TRACES_SAMPLE_RATE ?? 1),
4642
profileSessionSampleRate: Number(process.env.SENTRY_PROFILE_SESSION_SAMPLE_RATE ?? 1),

0 commit comments

Comments
 (0)