Class SdkObservableMeasurement
java.lang.Object
io.opentelemetry.sdk.metrics.internal.state.SdkObservableMeasurement
- All Implemented Interfaces:
ObservableDoubleMeasurement, ObservableLongMeasurement, ObservableMeasurement
public final class SdkObservableMeasurement
extends Object
implements ObservableLongMeasurement, ObservableDoubleMeasurement
Records values from asynchronous instruments to associated
AsynchronousMetricStorage.
This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
-
Method Summary
Modifier and TypeMethodDescriptionstatic SdkObservableMeasurementcreate(InstrumentationScopeInfo instrumentationScopeInfo, InstrumentDescriptor instrumentDescriptor, List<AsynchronousMetricStorage<?, ?>> storages) Create aSdkObservableMeasurement.Get the instrumentation scope info.voidrecord(double value) Records a measurement.voidrecord(double value, Attributes attributes) Records a measurement with a set of attributes.voidrecord(long value) Records a measurement.voidrecord(long value, Attributes attributes) Records a measurement with a set of attributes.voidsetActiveReader(RegisteredReader registeredReader, long startEpochNanos, long epochNanos) Set the active reader, and clock information.voidUnset the active reader.
-
Method Details
-
create
public static SdkObservableMeasurement create(InstrumentationScopeInfo instrumentationScopeInfo, InstrumentDescriptor instrumentDescriptor, List<AsynchronousMetricStorage<?, ?>> storages) Create aSdkObservableMeasurement.- Parameters:
instrumentationScopeInfo- the instrumentation scope info of corresponding meterinstrumentDescriptor- the instrument descriptorstorages- the storages to record to- Returns:
- the observable measurement
-
getInstrumentationScopeInfo
Get the instrumentation scope info. -
setActiveReader
public void setActiveReader(RegisteredReader registeredReader, long startEpochNanos, long epochNanos) Set the active reader, and clock information.unsetActiveReader()MUST be called after. -
unsetActiveReader
public void unsetActiveReader()Unset the active reader. Called aftersetActiveReader(RegisteredReader, long, long). -
record
public void record(long value) Description copied from interface:ObservableLongMeasurementRecords a measurement.- Specified by:
recordin interfaceObservableLongMeasurement- Parameters:
value- The measurement value.
-
record
Description copied from interface:ObservableLongMeasurementRecords a measurement with a set of attributes.- Specified by:
recordin interfaceObservableLongMeasurement- Parameters:
value- The measurement value.attributes- A set of attributes to associate with the value.
-
record
public void record(double value) Description copied from interface:ObservableDoubleMeasurementRecords a measurement.- Specified by:
recordin interfaceObservableDoubleMeasurement- Parameters:
value- The measurement value.
-
record
Description copied from interface:ObservableDoubleMeasurementRecords a measurement with a set of attributes.- Specified by:
recordin interfaceObservableDoubleMeasurement- Parameters:
value- The measurement value.attributes- A set of attributes to associate with the value.
-