mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-27 21:08:00 +00:00
feat(analytics): enable low-rate browser Sentry tracing (#2520)
This commit is contained in:
@@ -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');
|
||||
});
|
||||
|
||||
@@ -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'],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user