Package io.opentelemetry.api.metrics
Interface Instrument.Builder
-
- All Known Subinterfaces:
AsynchronousInstrument.Builder
,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.Builder
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.Instrument.Builder
setDescription(String description)
Sets the description of theInstrument
.Instrument.Builder
setUnit(String unit)
Sets the unit of theInstrument
.
-
-
-
Method Detail
-
setDescription
Instrument.Builder setDescription(String description)
Sets the description of theInstrument
.Default value is
""
.- Parameters:
description
- the description of the Instrument.- Returns:
- this.
-
setUnit
Instrument.Builder 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.
-
-