Package io.opentelemetry.api.metrics
Interface InstrumentBuilder
-
- All Known Subinterfaces:
AsynchronousInstrumentBuilder<R>,DoubleCounterBuilder,DoubleSumObserverBuilder,DoubleUpDownCounterBuilder,DoubleUpDownSumObserverBuilder,DoubleValueObserverBuilder,DoubleValueRecorderBuilder,LongCounterBuilder,LongSumObserverBuilder,LongUpDownCounterBuilder,LongUpDownSumObserverBuilder,LongValueObserverBuilder,LongValueRecorderBuilder,SynchronousInstrumentBuilder
public interface InstrumentBuilderTheBuilderclass for theInstrument.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Instrumentbuild()Builds and returns aInstrumentwith the desired options.InstrumentBuildersetDescription(String description)Sets the description of theInstrument.InstrumentBuildersetUnit(String unit)Sets the unit of theInstrument.
-
-
-
Method Detail
-
setDescription
InstrumentBuilder setDescription(String description)
Sets the description of theInstrument.Default value is
"".- Parameters:
description- the description of the Instrument.- Returns:
- this.
-
setUnit
InstrumentBuilder setUnit(String unit)
Sets the unit of theInstrument.Default value is
"1".- Parameters:
unit- the unit of the Instrument.- Returns:
- this.
-
build
Instrument build()
Builds and returns aInstrumentwith the desired options.- Returns:
- a
Instrumentwith the desired options.
-
-