File tree Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 11/* eslint-disable max-lines */ // TODO: We might want to split this file up
22import { EventType , record } from '@sentry-internal/rrweb' ;
3- import { captureException } from '@sentry/core' ;
3+ import { captureException , getCurrentHub } from '@sentry/core' ;
44import type { Breadcrumb , ReplayRecordingMode } from '@sentry/types' ;
55import { logger } from '@sentry/utils' ;
66
@@ -807,9 +807,16 @@ export class ReplayContainer implements ReplayContainerInterface {
807807 } catch ( err ) {
808808 this . _handleException ( err ) ;
809809
810- // This means we retried 3 times, and all of them failed
810+ // This means we retried 3 times and all of them failed,
811+ // or we ran into a problem we don't want to retry, like rate limiting.
811812 // In this case, we want to completely stop the replay - otherwise, we may get inconsistent segments
812813 this . stop ( ) ;
814+
815+ const client = getCurrentHub ( ) . getClient ( ) ;
816+
817+ if ( client ) {
818+ client . recordDroppedEvent ( 'send_error' , 'replay' ) ;
819+ }
813820 }
814821 }
815822
Original file line number Diff line number Diff line change 1+ import { getCurrentHub } from '@sentry/core' ;
12import { logger } from '@sentry/utils' ;
23
34import { SESSION_IDLE_DURATION } from '../constants' ;
@@ -46,5 +47,11 @@ export async function addEvent(
4647 } catch ( error ) {
4748 __DEBUG_BUILD__ && logger . error ( error ) ;
4849 replay . stop ( ) ;
50+
51+ const client = getCurrentHub ( ) . getClient ( ) ;
52+
53+ if ( client ) {
54+ client . recordDroppedEvent ( 'internal_sdk_error' , 'replay' ) ;
55+ }
4956 }
5057}
Original file line number Diff line number Diff line change @@ -6,7 +6,9 @@ export type EventDropReason =
66 | 'network_error'
77 | 'queue_overflow'
88 | 'ratelimit_backoff'
9- | 'sample_rate' ;
9+ | 'sample_rate'
10+ | 'send_error'
11+ | 'internal_sdk_error' ;
1012
1113export type Outcome = {
1214 reason : EventDropReason ;
You can’t perform that action at this time.
0 commit comments