/* eslint-disable import/no-absolute-path */ // Error reporter (server). Was flowkey:raven (raven@2.4.1, Sentry legacy SDK), // which is dead on Meteor 3 and, with a dead DSN, spammed the boot log with // "failed to send exception to sentry: HTTP Error (502)". Replaced by the // modern @sentry/node SDK behind the same `.log()` facade so the 6 call sites // don't change. With no DSN configured it is a pure console logger (identical // to the old "disabled" branch) — ready to point at a DSN when Sentry/GlitchTip // is back, via Meteor.settings.sentryPrivateDSN. import * as Sentry from '@sentry/node'; import { Meteor } from 'meteor/meteor'; const dsn = Meteor.settings.sentryPrivateDSN; const enabled = !!dsn; if (enabled) { Sentry.init({ dsn, environment: Meteor.isDevelopment ? 'development' : 'production', // errors only; no tracing/profiling (avoids the OTel auto-instrumentation) tracesSampleRate: 0 }); } const ravenLogger = { log(error, extra) { console.error(error); if (enabled) { Sentry.captureException(error, extra ? { extra: { info: extra } } : undefined); } } }; console.log(`sentryLogger (server) ${enabled ? 'enabled' : 'disabled'}`); export default ravenLogger;