@@ -9,24 +9,25 @@ const SENTRY_DSN = process.env['SENTRY_DSN'];
99const SENTRY_ENVIRONMENT = 'production' ;
1010const SENTRY_RELEASE = 'v1.0.0' ;
1111
12- if ( SENTRY_DSN === undefined || SENTRY_DSN === 0 ) {
13- console . info ( '[INFO][SENTRY][LOG] Not using Sentry as it is disabled by not setting SENTRY_DSN env var' ) ;
14- return ;
12+ if ( ! SENTRY_DSN || SENTRY_DSN . trim ( ) === '' ) {
13+ console . info (
14+ '[INFO][SENTRY][LOG] Not using Sentry as it is disabled by not setting SENTRY_DSN env var' ,
15+ ) ;
16+ } else {
17+ // Initialize Sentry
18+ console . info ( '[INFO][SENTRY][INIT] Initializing Sentry error reporting' ) ;
19+ Sentry . init ( {
20+ dsn : SENTRY_DSN ,
21+ environment : SENTRY_ENVIRONMENT ,
22+ release : SENTRY_RELEASE ,
23+ sendDefaultPii : true ,
24+ tracesSampleRate : 1.0 ,
25+ profileSessionSampleRate : 1.0 ,
26+ profileLifecycle : 'trace' ,
27+ integrations : [
28+ nodeProfilingIntegration ( ) ,
29+ Sentry . graphqlIntegration ( { useOperationNameForRootSpan : true } ) ,
30+ ] ,
31+ debug : false ,
32+ } ) ;
1533}
16-
17- // Initialize Sentry
18- console . info ( '[INFO][SENTRY][INIT] Initializing Sentry error reporting' ) ;
19- Sentry . init ( {
20- dsn : SENTRY_DSN ,
21- environment : SENTRY_ENVIRONMENT ,
22- release : SENTRY_RELEASE ,
23- sendDefaultPii : true ,
24- tracesSampleRate : 1.0 ,
25- profileSessionSampleRate : 1.0 ,
26- profileLifecycle : 'trace' ,
27- integrations : [
28- nodeProfilingIntegration ( ) ,
29- Sentry . graphqlIntegration ( { useOperationNameForRootSpan : true } ) ,
30- ] ,
31- debug : false ,
32- } ) ;
0 commit comments