This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

semble / src / instrument.ts
1.1 kB 34 lines
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 // Determine release from environment (git SHA injected during deployment) 9 const release = 10 process.env.SENTRY_RELEASE || process.env.GIT_SHA || undefined; 11 12 Sentry.init({ 13 dsn: sentryConfig.dsn, 14 environment: sentryConfig.environment, 15 release: release, 16 // Performance Monitoring - Start at 10% to manage costs (Fly.io recommendation) 17 tracesSampleRate: 1.0, 18 // Send default PII (includes IP addresses, user data) 19 sendDefaultPii: true, 20 }); 21 22 // Add Fly.io-specific context tags 23 Sentry.setTags({ 24 serverName: process.env.FLY_MACHINE_ID || 'local', 25 region: process.env.FLY_REGION || 'local', 26 processType: process.env.PROCESS_TYPE || 'unknown', 27 }); 28 29 console.log( 30 `[Sentry] Initialized for environment: ${sentryConfig.environment}${release ? ` (release: ${release})` : ''}`, 31 ); 32} else { 33 console.log('[Sentry] Skipped initialization (no DSN provided)'); 34}