@@ -16,7 +16,6 @@ import type {
1616 FeedbackEvent ,
1717 Integration ,
1818 IntegrationClass ,
19- MetricBucketItem ,
2019 Outcome ,
2120 ParameterizedString ,
2221 SdkMetadata ,
@@ -52,7 +51,6 @@ import { createEventEnvelope, createSessionEnvelope } from './envelope';
5251import type { IntegrationIndex } from './integration' ;
5352import { afterSetupIntegrations } from './integration' ;
5453import { setupIntegration , setupIntegrations } from './integration' ;
55- import { createMetricEnvelope } from './metrics/envelope' ;
5654import type { Scope } from './scope' ;
5755import { updateSession } from './session' ;
5856import { getDynamicSamplingContextFromClient } from './tracing/dynamicSamplingContext' ;
@@ -377,7 +375,7 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> {
377375 env = addItemToEnvelope ( env , createAttachmentEnvelopeItem ( attachment ) ) ;
378376 }
379377
380- const promise = this . _sendEnvelope ( env ) ;
378+ const promise = this . sendEnvelope ( env ) ;
381379 if ( promise ) {
382380 promise . then ( sendResponse => this . emit ( 'afterSendEvent' , event , sendResponse ) , null ) ;
383381 }
@@ -389,9 +387,9 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> {
389387 public sendSession ( session : Session | SessionAggregates ) : void {
390388 const env = createSessionEnvelope ( session , this . _dsn , this . _options . _metadata , this . _options . tunnel ) ;
391389
392- // _sendEnvelope should not throw
390+ // sendEnvelope should not throw
393391 // eslint-disable-next-line @typescript-eslint/no-floating-promises
394- this . _sendEnvelope ( env ) ;
392+ this . sendEnvelope ( env ) ;
395393 }
396394
397395 /**
@@ -415,23 +413,6 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> {
415413 }
416414 }
417415
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-
435416 // Keep on() & emit() signatures in sync with types' client.ts interface
436417 /* eslint-disable @typescript-eslint/unified-signatures */
437418
@@ -540,6 +521,21 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> {
540521 }
541522 }
542523
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+
543539 /* eslint-enable @typescript-eslint/unified-signatures */
544540
545541 /** Setup integrations for this client. */
@@ -823,21 +819,6 @@ export abstract class BaseClient<O extends ClientOptions> implements Client<O> {
823819 ) ;
824820 }
825821
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-
841822 /**
842823 * Clears outcomes on this client and returns them.
843824 */
0 commit comments