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 {
2929export type { RequestInstrumentationOptions } from '@sentry-internal/tracing' ;
3030export {
3131 addTracingExtensions ,
32+ setMeasurement ,
3233 extractTraceparentData ,
3334 getActiveTransaction ,
3435 spanStatusfromHttpCode ,
Original file line number Diff line number Diff line change @@ -8,3 +8,4 @@ export { SpanStatus } from './spanstatus';
88export type { SpanStatusType } from './span' ;
99export { trace } from './trace' ;
1010export { 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 {
5454 trace ,
5555 withScope ,
5656 captureCheckIn ,
57+ setMeasurement ,
5758} from '@sentry/core' ;
5859export type { SpanStatusType } from '@sentry/core' ;
5960export { autoDiscoverNodePerformanceMonitoringIntegrations } from './tracing' ;
Original file line number Diff line number Diff line change @@ -49,4 +49,5 @@ export {
4949 deepReadDirSync ,
5050 Handlers ,
5151 Integrations ,
52+ setMeasurement ,
5253} from '@sentry/node' ;
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ export {
4444 deepReadDirSync ,
4545 Integrations ,
4646 Handlers ,
47+ setMeasurement ,
4748} from '@sentry/node' ;
4849
4950// We can still leave this for the carrier init and type exports
You can’t perform that action at this time.
0 commit comments