File tree Expand file tree Collapse file tree 6 files changed +18
-0
lines changed Expand file tree Collapse file tree 6 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ export {
29
29
export type { RequestInstrumentationOptions } from '@sentry-internal/tracing' ;
30
30
export {
31
31
addTracingExtensions ,
32
+ setMeasurement ,
32
33
extractTraceparentData ,
33
34
getActiveTransaction ,
34
35
spanStatusfromHttpCode ,
Original file line number Diff line number Diff line change @@ -8,3 +8,4 @@ export { SpanStatus } from './spanstatus';
8
8
export type { SpanStatusType } from './span' ;
9
9
export { trace } from './trace' ;
10
10
export { getDynamicSamplingContextFromClient } from './dynamicSamplingContext' ;
11
+ export { setMeasurement } from './measurement' ;
Original file line number Diff line number Diff line change
1
+ import type { MeasurementUnit } from '@sentry/types' ;
2
+
3
+ import { getActiveTransaction } from './utils' ;
4
+
5
+ /**
6
+ * Adds a measurement to the current active transaction.
7
+ */
8
+ export function setMeasurement ( name : string , value : number , unit : MeasurementUnit ) : void {
9
+ const transaction = getActiveTransaction ( ) ;
10
+ if ( transaction ) {
11
+ transaction . setMeasurement ( name , value , unit ) ;
12
+ }
13
+ }
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ export {
54
54
trace ,
55
55
withScope ,
56
56
captureCheckIn ,
57
+ setMeasurement ,
57
58
} from '@sentry/core' ;
58
59
export type { SpanStatusType } from '@sentry/core' ;
59
60
export { autoDiscoverNodePerformanceMonitoringIntegrations } from './tracing' ;
Original file line number Diff line number Diff line change @@ -49,4 +49,5 @@ export {
49
49
deepReadDirSync ,
50
50
Handlers ,
51
51
Integrations ,
52
+ setMeasurement ,
52
53
} from '@sentry/node' ;
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ export {
44
44
deepReadDirSync ,
45
45
Integrations ,
46
46
Handlers ,
47
+ setMeasurement ,
47
48
} from '@sentry/node' ;
48
49
49
50
// We can still leave this for the carrier init and type exports
You can’t perform that action at this time.
0 commit comments