Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/instrumentation-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import * as Spotlight from '@spotlightjs/spotlight';
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,

// Ignore errors injected by Brave/Firefox iOS browser scripts (third-party browser noise)
ignoreErrors: [/__firefox__/, /DarkReader/],
// Ignore errors from third-party/injected scripts (browser extensions, ad-blockers, etc.)
ignoreErrors: [/__firefox__/, /DarkReader/, /^he$/],

// Adjust this value in production, or use tracesSampler for greater control
tracesSampleRate: 0.3,
Expand Down Expand Up @@ -40,6 +40,17 @@ Sentry.init({
Sentry.consoleLoggingIntegration(),
],

beforeSend(event) {
const values = event.exception?.values;
if (values?.length === 1) {
const frames = values[0].stacktrace?.frames;
if (!frames || frames.length === 0) {
return null;
}
}
return event;
},

// Filter sensitive metric attributes (no PII in metrics)
beforeSendMetric: metric => {
// Remove any accidentally added PII attributes
Expand Down
Loading