Package io.opentelemetry.api.metrics
Interface DoubleUpDownCounterBuilder
-
public interface DoubleUpDownCounterBuilderBuilder class forDoubleUpDownCounter.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DoubleUpDownCounterbuild()Builds and returns aDoubleUpDownCounterwith the desired options.voidbuildWithCallback(Consumer<ObservableDoubleMeasurement> callback)Builds this asynchronous instrument with the given callback.LongUpDownCounterBuilderofLongs()Sets the counter for recordinglongvalues.DoubleUpDownCounterBuildersetDescription(String description)Sets the description for this instrument.DoubleUpDownCounterBuildersetUnit(String unit)Sets the unit of measure for this instrument.
-
-
-
Method Detail
-
setDescription
DoubleUpDownCounterBuilder 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
DoubleUpDownCounterBuilder 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
-
ofLongs
LongUpDownCounterBuilder ofLongs()
Sets the counter for recordinglongvalues.
-
build
DoubleUpDownCounter build()
Builds and returns aDoubleUpDownCounterwith the desired options.- Returns:
- a
DoubleUpDownCounterwith the desired options.
-
buildWithCallback
void buildWithCallback(Consumer<ObservableDoubleMeasurement> 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.
-
-