Package io.opentelemetry.api.metrics
Interface LongCounterBuilder
-
public interface LongCounterBuilderBuilder class forLongCounter.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description LongCounterbuild()Builds and returns aLongCounterwith the desired options.voidbuildWithCallback(Consumer<ObservableLongMeasurement> callback)Builds this asynchronous instrument with the given callback.DoubleCounterBuilderofDoubles()Sets the counter for recordingdoublevalues.LongCounterBuildersetDescription(String description)Sets the description for this instrument.LongCounterBuildersetUnit(String unit)Sets the unit of measure for this instrument.
-
-
-
Method Detail
-
setDescription
LongCounterBuilder setDescription(String description)
Sets the description for this instrument.Description strings should follow the instrument description rules: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#instrument-description
-
setUnit
LongCounterBuilder setUnit(String unit)
Sets the unit of measure for this instrument.Unit strings should follow the instrument unit rules: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#instrument-unit
-
ofDoubles
DoubleCounterBuilder ofDoubles()
Sets the counter for recordingdoublevalues.
-
build
LongCounter build()
Builds and returns aLongCounterwith the desired options.- Returns:
- a
LongCounterwith the desired options.
-
buildWithCallback
void buildWithCallback(Consumer<ObservableLongMeasurement> callback)
Builds this asynchronous instrument with the given callback.The callback will only be called when the
Meteris being observed.- Parameters:
callback- A state-capturing callback used to observe values on-demand.
-
-