import * as Sentry from '@sentry/node';
/**
 * Initialise Sentry on Node. No-op when SENTRY_DSN is empty (dev/local).
 * Chame uma vez no boot, ANTES de Fastify ser instanciado.
 */
export function initSentry() {
    const dsn = process.env.SENTRY_DSN ?? '';
    if (!dsn) {
        console.log('[sentry] dsn vazio, captura desligada');
        return;
    }
    Sentry.init({
        dsn,
        environment: process.env.DOPPLER_CONFIG ?? 'dev',
        release: process.env.RELEASE ?? undefined,
        tracesSampleRate: 0.1,
        sendDefaultPii: false,
    });
    console.log(`[sentry] ativado (env=${process.env.DOPPLER_CONFIG ?? 'dev'})`);
}
/** Captura erro programaticamente (no-op se Sentry nao iniciado). */
export function captureError(err) {
    Sentry.captureException(err);
}
export { Sentry };
//# sourceMappingURL=sentry.js.map