Package io.opentelemetry.api.metrics
Interface AsynchronousInstrument.Builder<R extends AsynchronousInstrument.Result>
-
- All Superinterfaces:
Instrument.Builder
- All Known Subinterfaces:
DoubleSumObserver.Builder,DoubleUpDownSumObserver.Builder,DoubleValueObserver.Builder,LongSumObserver.Builder,LongUpDownSumObserver.Builder,LongValueObserver.Builder
- Enclosing interface:
- AsynchronousInstrument<R extends AsynchronousInstrument.Result>
public static interface AsynchronousInstrument.Builder<R extends AsynchronousInstrument.Result> extends Instrument.Builder
Builder class forAsynchronousInstrument.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AsynchronousInstrument<R>build()Builds and returns aInstrumentwith the desired options.AsynchronousInstrument.Builder<R>setCallback(AsynchronousInstrument.Callback<R> callback)Sets a callback that gets executed every collection interval.-
Methods inherited from interface io.opentelemetry.api.metrics.Instrument.Builder
setDescription, setUnit
-
-
-
-
Method Detail
-
setCallback
AsynchronousInstrument.Builder<R> setCallback(AsynchronousInstrument.Callback<R> callback)
Sets a callback that gets executed every collection interval.Evaluation is deferred until needed, if this
AsynchronousInstrumentmetric is not exported then it will never be called.- Parameters:
callback- the callback to be executed before export.
-
build
AsynchronousInstrument<R> build()
Description copied from interface:Instrument.BuilderBuilds and returns aInstrumentwith the desired options.- Specified by:
buildin interfaceInstrument.Builder- Returns:
- a
Instrumentwith the desired options.
-
-