diff --git a/packages/core/src/tracing/measurement.ts b/packages/core/src/tracing/measurement.ts index 817569a03930..c8802023bf2e 100644 --- a/packages/core/src/tracing/measurement.ts +++ b/packages/core/src/tracing/measurement.ts @@ -6,10 +6,10 @@ import { import { getActiveSpan, getRootSpan } from '../utils/spanUtils'; /** - * Adds a measurement to the current active transaction. + * Adds a measurement to the active transaction on the current global scope. You can optionally pass in a different span + * as the 4th parameter. */ -export function setMeasurement(name: string, value: number, unit: MeasurementUnit): void { - const activeSpan = getActiveSpan(); +export function setMeasurement(name: string, value: number, unit: MeasurementUnit, activeSpan = getActiveSpan()): void { const rootSpan = activeSpan && getRootSpan(activeSpan); if (rootSpan) {