@@ -16,7 +16,6 @@ import type {
16
16
FeedbackEvent ,
17
17
Integration ,
18
18
IntegrationClass ,
19
- MetricBucketItem ,
20
19
Outcome ,
21
20
ParameterizedString ,
22
21
SdkMetadata ,
@@ -52,7 +51,6 @@ import { createEventEnvelope, createSessionEnvelope } from './envelope';
52
51
import type { IntegrationIndex } from './integration' ;
53
52
import { afterSetupIntegrations } from './integration' ;
54
53
import { setupIntegration , setupIntegrations } from './integration' ;
55
- import { createMetricEnvelope } from './metrics/envelope' ;
56
54
import type { Scope } from './scope' ;
57
55
import { updateSession } from './session' ;
58
56
import { getDynamicSamplingContextFromClient } from './tracing/dynamicSamplingContext' ;
@@ -377,7 +375,7 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> {
377
375
env = addItemToEnvelope ( env , createAttachmentEnvelopeItem ( attachment ) ) ;
378
376
}
379
377
380
- const promise = this . _sendEnvelope ( env ) ;
378
+ const promise = this . sendEnvelope ( env ) ;
381
379
if ( promise ) {
382
380
promise . then ( sendResponse => this . emit ( 'afterSendEvent' , event , sendResponse ) , null ) ;
383
381
}
@@ -389,9 +387,9 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> {
389
387
public sendSession ( session : Session | SessionAggregates ) : void {
390
388
const env = createSessionEnvelope ( session , this . _dsn , this . _options . _metadata , this . _options . tunnel ) ;
391
389
392
- // _sendEnvelope should not throw
390
+ // sendEnvelope should not throw
393
391
// eslint-disable-next-line @typescript-eslint/no-floating-promises
394
- this . _sendEnvelope ( env ) ;
392
+ this . sendEnvelope ( env ) ;
395
393
}
396
394
397
395
/**
@@ -415,23 +413,6 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> {
415
413
}
416
414
}
417
415
418
- /**
419
- * @inheritDoc
420
- */
421
- public captureAggregateMetrics ( metricBucketItems : Array < MetricBucketItem > ) : void {
422
- DEBUG_BUILD && logger . log ( `Flushing aggregated metrics, number of metrics: ${ metricBucketItems . length } ` ) ;
423
- const metricsEnvelope = createMetricEnvelope (
424
- metricBucketItems ,
425
- this . _dsn ,
426
- this . _options . _metadata ,
427
- this . _options . tunnel ,
428
- ) ;
429
-
430
- // _sendEnvelope should not throw
431
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
432
- this . _sendEnvelope ( metricsEnvelope ) ;
433
- }
434
-
435
416
// Keep on() & emit() signatures in sync with types' client.ts interface
436
417
/* eslint-disable @typescript-eslint/unified-signatures */
437
418
@@ -540,6 +521,21 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> {
540
521
}
541
522
}
542
523
524
+ /**
525
+ * @inheritdoc
526
+ */
527
+ public sendEnvelope ( envelope : Envelope ) : PromiseLike < void | TransportMakeRequestResponse > | void {
528
+ this . emit ( 'beforeEnvelope' , envelope ) ;
529
+
530
+ if ( this . _isEnabled ( ) && this . _transport ) {
531
+ return this . _transport . send ( envelope ) . then ( null , reason => {
532
+ DEBUG_BUILD && logger . error ( 'Error while sending event:' , reason ) ;
533
+ } ) ;
534
+ } else {
535
+ DEBUG_BUILD && logger . error ( 'Transport disabled' ) ;
536
+ }
537
+ }
538
+
543
539
/* eslint-enable @typescript-eslint/unified-signatures */
544
540
545
541
/** Setup integrations for this client. */
@@ -823,21 +819,6 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> {
823
819
) ;
824
820
}
825
821
826
- /**
827
- * @inheritdoc
828
- */
829
- protected _sendEnvelope ( envelope : Envelope ) : PromiseLike < void | TransportMakeRequestResponse > | void {
830
- this . emit ( 'beforeEnvelope' , envelope ) ;
831
-
832
- if ( this . _isEnabled ( ) && this . _transport ) {
833
- return this . _transport . send ( envelope ) . then ( null , reason => {
834
- DEBUG_BUILD && logger . error ( 'Error while sending event:' , reason ) ;
835
- } ) ;
836
- } else {
837
- DEBUG_BUILD && logger . error ( 'Transport disabled' ) ;
838
- }
839
- }
840
-
841
822
/**
842
823
* Clears outcomes on this client and returns them.
843
824
*/
0 commit comments