Package io.opentelemetry.api.metrics
Interface AsynchronousInstrumentBuilder<R>
-
- All Superinterfaces:
InstrumentBuilder
- All Known Subinterfaces:
DoubleSumObserverBuilder,DoubleUpDownSumObserverBuilder,DoubleValueObserverBuilder,LongSumObserverBuilder,LongUpDownSumObserverBuilder,LongValueObserverBuilder
public interface AsynchronousInstrumentBuilder<R> extends InstrumentBuilder
Builder class forAsynchronousInstrument.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AsynchronousInstrumentbuild()Builds and returns aInstrumentwith the desired options.AsynchronousInstrumentBuilder<R>setUpdater(Consumer<R> updater)Sets a consumer that gets executed every collection interval.-
Methods inherited from interface io.opentelemetry.api.metrics.InstrumentBuilder
setDescription, setUnit
-
-
-
-
Method Detail
-
setUpdater
AsynchronousInstrumentBuilder<R> setUpdater(Consumer<R> updater)
Sets a consumer that gets executed every collection interval.Evaluation is deferred until needed, if this
AsynchronousInstrumentmetric is not exported then it will never be called.- Parameters:
updater- the consumer to be executed before export.
-
build
AsynchronousInstrument build()
Description copied from interface:InstrumentBuilderBuilds and returns aInstrumentwith the desired options.- Specified by:
buildin interfaceInstrumentBuilder- Returns:
- a
Instrumentwith the desired options.
-
-