@@ -3,6 +3,7 @@ import { logger } from '@sentry/utils';
33import type { BaseClient } from '../baseclient' ;
44import { DEBUG_BUILD } from '../debug-build' ;
55import { getCurrentHub } from '../hub' ;
6+ import { COUNTER_METRIC_TYPE , DISTRIBUTION_METRIC_TYPE , GAUGE_METRIC_TYPE , SET_METRIC_TYPE } from './constants' ;
67import type { MetricType } from './types' ;
78
89interface MetricData {
@@ -48,7 +49,7 @@ function addToMetricsAggregator(metricType: MetricType, name: string, value: num
4849 * @experimental This API is experimental and might having breaking changes in the future.
4950 */
5051export function incr ( name : string , value : number , data ?: MetricData ) : void {
51- addToMetricsAggregator ( 'c' , name , value , data ) ;
52+ addToMetricsAggregator ( COUNTER_METRIC_TYPE , name , value , data ) ;
5253}
5354
5455/**
@@ -57,7 +58,7 @@ export function incr(name: string, value: number, data?: MetricData): void {
5758 * @experimental This API is experimental and might having breaking changes in the future.
5859 */
5960export function distribution ( name : string , value : number , data ?: MetricData ) : void {
60- addToMetricsAggregator ( 'd' , name , value , data ) ;
61+ addToMetricsAggregator ( DISTRIBUTION_METRIC_TYPE , name , value , data ) ;
6162}
6263
6364/**
@@ -66,7 +67,7 @@ export function distribution(name: string, value: number, data?: MetricData): vo
6667 * @experimental This API is experimental and might having breaking changes in the future.
6768 */
6869export function set ( name : string , value : number , data ?: MetricData ) : void {
69- addToMetricsAggregator ( 's' , name , value , data ) ;
70+ addToMetricsAggregator ( SET_METRIC_TYPE , name , value , data ) ;
7071}
7172
7273/**
@@ -75,5 +76,5 @@ export function set(name: string, value: number, data?: MetricData): void {
7576 * @experimental This API is experimental and might having breaking changes in the future.
7677 */
7778export function gauge ( name : string , value : number , data ?: MetricData ) : void {
78- addToMetricsAggregator ( 's' , name , value , data ) ;
79+ addToMetricsAggregator ( GAUGE_METRIC_TYPE , name , value , data ) ;
7980}
0 commit comments