feat(analytics): enable low-rate browser Sentry tracing (#2520)

This commit is contained in:
Steven Enamakel
2026-05-23 01:16:54 -07:00
committed by GitHub
parent 97553caf23
commit 5aa6fbb8e9
2 changed files with 10 additions and 6 deletions
@@ -300,9 +300,18 @@ describe('initSentry beforeSend manual-staging bypass', () => {
const opts = hoisted.init.mock.calls[0][0] as {
release: string;
tracesSampler: () => number;
replaysSessionSampleRate: number;
replaysOnErrorSampleRate: number;
integrations: Array<{ name?: string }>;
};
expect(opts.release).toBe('openhuman@test+abc');
hoisted.analyticsEnabled = true;
expect(opts.tracesSampler()).toBe(0.1);
hoisted.analyticsEnabled = false;
expect(opts.tracesSampler()).toBe(0);
expect(opts.replaysSessionSampleRate).toBe(0);
expect(opts.replaysOnErrorSampleRate).toBe(0);
const names = opts.integrations.map(i => i.name).filter(Boolean);
expect(names).toContain('HttpContext');
});
+1 -6
View File
@@ -101,7 +101,7 @@ export function initSentry(): void {
// Privacy: disable EVERYTHING that could leak sensitive state.
replaysSessionSampleRate: 0,
replaysOnErrorSampleRate: 0,
tracesSampleRate: 0,
tracesSampler: () => (isAnalyticsEnabled() ? 0.1 : 0),
defaultIntegrations: false,
integrations: [
Sentry.functionToStringIntegration(),
@@ -191,11 +191,6 @@ export function initSentry(): void {
return event;
},
beforeSendTransaction() {
// Block all transactions (performance traces).
return null;
},
// Ignore common non-actionable errors.
ignoreErrors: ['ResizeObserver loop', 'Network request failed', 'Load failed', 'AbortError'],
});