@@ -19,7 +19,7 @@ import {
1919import * as integrationModule from '../../src/integration' ;
2020import * as logsInternalModule from '../../src/logs/internal' ;
2121import { _INTERNAL_captureLog } from '../../src/logs/internal' ;
22- import { _INTERNAL_captureMetric } from '../../src/metrics/internal' ;
22+ import { captureMetric } from '../../src/metrics/internal' ;
2323import * as traceModule from '../../src/tracing/trace' ;
2424import { DEFAULT_TRANSPORT_BUFFER_SIZE } from '../../src/transports/base' ;
2525import type { Envelope } from '../../src/types/envelope' ;
@@ -4425,11 +4425,11 @@ describe('Client', () => {
44254425
44264426 expect ( onSpy ) . not . toHaveBeenCalledWith ( 'afterCaptureMetric' , expect . any ( Function ) ) ;
44274427
4428- _INTERNAL_captureMetric ( { name : 'metric1' , value : 1 , type : 'counter' , attributes : { } } , { scope } ) ;
4428+ captureMetric ( { name : 'metric1' , value : 1 , type : 'counter' , attributes : { } } , { scope } ) ;
44294429 expect ( onSpy ) . toHaveBeenCalledWith ( 'afterCaptureMetric' , expect . any ( Function ) ) ;
44304430
44314431 onSpy . mockClear ( ) ;
4432- _INTERNAL_captureMetric ( { name : 'metric2' , value : 2 , type : 'counter' , attributes : { } } , { scope } ) ;
4432+ captureMetric ( { name : 'metric2' , value : 2 , type : 'counter' , attributes : { } } , { scope } ) ;
44334433 expect ( onSpy ) . not . toHaveBeenCalledWith ( 'afterCaptureMetric' , expect . any ( Function ) ) ;
44344434
44354435 onSpy . mockRestore ( ) ;
@@ -4447,7 +4447,7 @@ describe('Client', () => {
44474447
44484448 // Create large metrics that will exceed the 800KB threshold
44494449 const largeValue = 'x' . repeat ( 400_000 ) ; // 400KB string
4450- _INTERNAL_captureMetric (
4450+ captureMetric (
44514451 { name : 'large_metric' , value : 1 , type : 'counter' , attributes : { large_value : largeValue } } ,
44524452 { scope } ,
44534453 ) ;
@@ -4466,7 +4466,7 @@ describe('Client', () => {
44664466 const sendEnvelopeSpy = vi . spyOn ( client , 'sendEnvelope' ) ;
44674467
44684468 // Create metrics that won't exceed the threshold
4469- _INTERNAL_captureMetric ( { name : 'test_metric' , value : 42 , type : 'counter' , attributes : { } } , { scope } ) ;
4469+ captureMetric ( { name : 'test_metric' , value : 42 , type : 'counter' , attributes : { } } , { scope } ) ;
44704470
44714471 expect ( sendEnvelopeSpy ) . not . toHaveBeenCalled ( ) ;
44724472 } ) ;
@@ -4482,8 +4482,8 @@ describe('Client', () => {
44824482 const sendEnvelopeSpy = vi . spyOn ( client , 'sendEnvelope' ) ;
44834483
44844484 // Add some metrics
4485- _INTERNAL_captureMetric ( { name : 'metric1' , value : 1 , type : 'counter' , attributes : { } } , { scope } ) ;
4486- _INTERNAL_captureMetric ( { name : 'metric2' , value : 2 , type : 'counter' , attributes : { } } , { scope } ) ;
4485+ captureMetric ( { name : 'metric1' , value : 1 , type : 'counter' , attributes : { } } , { scope } ) ;
4486+ captureMetric ( { name : 'metric2' , value : 2 , type : 'counter' , attributes : { } } , { scope } ) ;
44874487
44884488 // Trigger flush event
44894489 client . emit ( 'flush' ) ;
@@ -4502,7 +4502,7 @@ describe('Client', () => {
45024502 scope . setClient ( client ) ;
45034503
45044504 // Capture a metric which will start the flush timer
4505- _INTERNAL_captureMetric ( { name : 'test_metric' , value : 42 , type : 'counter' , attributes : { } } , { scope } ) ;
4505+ captureMetric ( { name : 'test_metric' , value : 42 , type : 'counter' , attributes : { } } , { scope } ) ;
45064506
45074507 // Verify safeUnref was called on the timer
45084508 expect ( safeUnrefSpy ) . toHaveBeenCalledTimes ( 1 ) ;
@@ -4522,7 +4522,7 @@ describe('Client', () => {
45224522 client . on ( 'flushMetrics' , flushMetricsHandler ) ;
45234523
45244524 // Capture a metric which starts the weight-based flush timer
4525- _INTERNAL_captureMetric ( { name : 'test_metric' , value : 42 , type : 'counter' , attributes : { } } , { scope } ) ;
4525+ captureMetric ( { name : 'test_metric' , value : 42 , type : 'counter' , attributes : { } } , { scope } ) ;
45264526
45274527 expect ( flushMetricsHandler ) . not . toHaveBeenCalled ( ) ;
45284528
@@ -4543,7 +4543,7 @@ describe('Client', () => {
45434543 const scope = new Scope ( ) ;
45444544 scope . setClient ( client ) ;
45454545
4546- _INTERNAL_captureMetric ( { name : 'test_metric' , value : 42 , type : 'counter' , attributes : { } } , { scope } ) ;
4546+ captureMetric ( { name : 'test_metric' , value : 42 , type : 'counter' , attributes : { } } , { scope } ) ;
45474547
45484548 expect ( safeUnrefSpy ) . not . toHaveBeenCalled ( ) ;
45494549
@@ -4561,7 +4561,7 @@ describe('Client', () => {
45614561
45624562 const sendEnvelopeSpy = vi . spyOn ( client , 'sendEnvelope' ) ;
45634563
4564- _INTERNAL_captureMetric ( { name : 'metric1' , value : 1 , type : 'counter' , attributes : { } } , { scope } ) ;
4564+ captureMetric ( { name : 'metric1' , value : 1 , type : 'counter' , attributes : { } } , { scope } ) ;
45654565
45664566 expect ( sendEnvelopeSpy ) . not . toHaveBeenCalled ( ) ;
45674567
@@ -4582,7 +4582,7 @@ describe('Client', () => {
45824582 const sendEnvelopeSpy = vi . spyOn ( client , 'sendEnvelope' ) ;
45834583
45844584 const largeValue = 'x' . repeat ( 400_000 ) ;
4585- _INTERNAL_captureMetric (
4585+ captureMetric (
45864586 { name : 'large_metric' , value : 1 , type : 'counter' , attributes : { large_value : largeValue } } ,
45874587 { scope } ,
45884588 ) ;
0 commit comments