This repository has no description
1import * as Sentry from '@sentry/node';
2import { configService } from './shared/infrastructure/config';
3
4const sentryConfig = configService.getSentryConfig();
5
6// Only initialize Sentry if DSN is provided
7if (sentryConfig.dsn) {
8 Sentry.init({
9 dsn: sentryConfig.dsn,
10 environment: sentryConfig.environment,
11 // Performance Monitoring
12 tracesSampleRate: 1.0, // Capture 100% of transactions for performance monitoring
13 // Send default PII (includes IP addresses, user data)
14 sendDefaultPii: true,
15 });
16
17 console.log(
18 `[Sentry] Initialized for environment: ${sentryConfig.environment}`,
19 );
20} else {
21 console.log('[Sentry] Skipped initialization (no DSN provided)');
22}