From c3faf1f6fcd02b01904a0e8f0f79f5f4b054c1c1 Mon Sep 17 00:00:00 2001 From: JD Francis Date: Wed, 13 Nov 2024 18:15:41 -0500 Subject: [PATCH] [C-5391] Add session replay to sentry (#10434) --- packages/web/src/services/sentry.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/web/src/services/sentry.ts b/packages/web/src/services/sentry.ts index aa65f027f59..965ad174c5b 100644 --- a/packages/web/src/services/sentry.ts +++ b/packages/web/src/services/sentry.ts @@ -30,7 +30,9 @@ export const initializeSentry = () => { // Catch failed network requests Sentry.httpClientIntegration(), // Capture console.errors in sentry - Sentry.captureConsoleIntegration({ levels: ['error'] }) + Sentry.captureConsoleIntegration({ levels: ['error'] }), + // Capture a session recording + Sentry.replayIntegration({}) ], normalizeDepth: 5, @@ -54,6 +56,10 @@ export const initializeSentry = () => { } } return breadCrumb - } + }, + // This is the sample rate for healthy sessions without errors - set to 0 since we only care about errors + replaysSessionSampleRate: 0, + // This is a sample rate specific to when errors occur. We want to see 100% of them + replaysOnErrorSampleRate: 1.0 }) }