brackt/instrument.server.mjs

15 lines
492 B
JavaScript
Raw Normal View History

import * as Sentry from '@sentry/react-router';
Sentry.init({
dsn: "https://1a366de494f1acf8fc94a4c592807b10@o1356837.ingest.us.sentry.io/4511024367861760",
enabled: process.env.NODE_ENV === "production",
sendDefaultPii: true,
tracesSampleRate: 0,
beforeSend(event) {
const msg = event.exception?.values?.[0]?.value ?? "";
// Drop React Flight protocol probe errors (e.g. $1:aa:aa in multipart body)
if (/\$\d+:[a-z]/.test(msg)) return null;
return event;
},
});