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 InstrumentBuilder
TheBuilder
class for theInstrument
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Instrument
build()
Builds and returns aInstrument
with the desired options.InstrumentBuilder
setDescription(String description)
Sets the description of theInstrument
.InstrumentBuilder
setUnit(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 aInstrument
with the desired options.- Returns:
- a
Instrument
with the desired options.
-
-