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 aInstrument
with 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
AsynchronousInstrument
metric 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.Builder
Builds and returns aInstrument
with the desired options.- Specified by:
build
in interfaceInstrument.Builder
- Returns:
- a
Instrument
with the desired options.
-
-