File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
packages/core/src/transports Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ import {
24
24
updateRateLimits ,
25
25
} from '@sentry/utils' ;
26
26
27
+ import { getCurrentHub } from '../hub' ;
28
+
27
29
export const DEFAULT_TRANSPORT_BUFFER_SIZE = 30 ;
28
30
29
31
/**
@@ -40,11 +42,14 @@ export function createTransport(
40
42
) ,
41
43
) : Transport {
42
44
let rateLimits : RateLimits = { } ;
43
-
44
45
const flush = ( timeout ?: number ) : PromiseLike < boolean > => buffer . drain ( timeout ) ;
46
+ const client = getCurrentHub ( ) . getClient ( ) ;
45
47
46
48
function send ( envelope : Envelope ) : PromiseLike < void | TransportMakeRequestResponse > {
47
49
const filteredEnvelopeItems : EnvelopeItem [ ] = [ ] ;
50
+ if ( client && client . emit ) {
51
+ client . emit ( 'beforeEnvelope' , envelope ) ;
52
+ }
48
53
49
54
// Drop rate limited items from envelope
50
55
forEachEnvelopeItem ( envelope , ( item , type ) => {
You can’t perform that action at this time.
0 commit comments