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 1
1
/* eslint-disable max-lines */ // TODO: We might want to split this file up
2
2
import { EventType , record } from '@sentry-internal/rrweb' ;
3
- import { captureException } from '@sentry/core' ;
3
+ import { captureException , getCurrentHub } from '@sentry/core' ;
4
4
import type { Breadcrumb , ReplayRecordingMode } from '@sentry/types' ;
5
5
import { logger } from '@sentry/utils' ;
6
6
@@ -807,9 +807,16 @@ export class ReplayContainer implements ReplayContainerInterface {
807
807
} catch ( err ) {
808
808
this . _handleException ( err ) ;
809
809
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.
811
812
// In this case, we want to completely stop the replay - otherwise, we may get inconsistent segments
812
813
this . stop ( ) ;
814
+
815
+ const client = getCurrentHub ( ) . getClient ( ) ;
816
+
817
+ if ( client ) {
818
+ client . recordDroppedEvent ( 'send_error' , 'replay' ) ;
819
+ }
813
820
}
814
821
}
815
822
Original file line number Diff line number Diff line change
1
+ import { getCurrentHub } from '@sentry/core' ;
1
2
import { logger } from '@sentry/utils' ;
2
3
3
4
import { SESSION_IDLE_DURATION } from '../constants' ;
@@ -46,5 +47,11 @@ export async function addEvent(
46
47
} catch ( error ) {
47
48
__DEBUG_BUILD__ && logger . error ( error ) ;
48
49
replay . stop ( ) ;
50
+
51
+ const client = getCurrentHub ( ) . getClient ( ) ;
52
+
53
+ if ( client ) {
54
+ client . recordDroppedEvent ( 'internal_sdk_error' , 'replay' ) ;
55
+ }
49
56
}
50
57
}
Original file line number Diff line number Diff line change @@ -6,7 +6,9 @@ export type EventDropReason =
6
6
| 'network_error'
7
7
| 'queue_overflow'
8
8
| 'ratelimit_backoff'
9
- | 'sample_rate' ;
9
+ | 'sample_rate'
10
+ | 'send_error'
11
+ | 'internal_sdk_error' ;
10
12
11
13
export type Outcome = {
12
14
reason : EventDropReason ;
You can’t perform that action at this time.
0 commit comments