Package io.opentelemetry.api.metrics
Interface Instrument.Builder
-
- All Known Subinterfaces:
AsynchronousInstrument.Builder<R>,DoubleCounter.Builder,DoubleSumObserver.Builder,DoubleUpDownCounter.Builder,DoubleUpDownSumObserver.Builder,DoubleValueObserver.Builder,DoubleValueRecorder.Builder,LongCounter.Builder,LongSumObserver.Builder,LongUpDownCounter.Builder,LongUpDownSumObserver.Builder,LongValueObserver.Builder,LongValueRecorder.Builder,SynchronousInstrument.Builder
- Enclosing interface:
- Instrument
public static interface Instrument.BuilderTheBuilderclass for theInstrument.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Instrumentbuild()Builds and returns aInstrumentwith the desired options.Instrument.BuildersetDescription(java.lang.String description)Sets the description of theInstrument.Instrument.BuildersetUnit(java.lang.String unit)Sets the unit of theInstrument.
-
-
-
Method Detail
-
setDescription
Instrument.Builder setDescription(java.lang.String description)
Sets the description of theInstrument.Default value is
"".- Parameters:
description- the description of the Instrument.- Returns:
- this.
-
setUnit
Instrument.Builder setUnit(java.lang.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.
-
-