Package io.opentelemetry.api.metrics
Interface SynchronousInstrument<B extends io.opentelemetry.api.metrics.BoundSynchronousInstrument>
-
- Type Parameters:
B
- the specific type of Bound Instrument this instrument can provide.
- All Superinterfaces:
Instrument
- All Known Subinterfaces:
DoubleCounter
,DoubleUpDownCounter
,DoubleValueRecorder
,LongCounter
,LongUpDownCounter
,LongValueRecorder
@ThreadSafe public interface SynchronousInstrument<B extends io.opentelemetry.api.metrics.BoundSynchronousInstrument> extends Instrument
SynchronousInstrument is an interface that defines a type of instruments that are used to report measurements synchronously. That is, when the user reports individual measurements as they occur.Synchronous instrument events additionally have a Context associated with them, describing properties of the associated trace and distributed correlation values.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description B
bind(Labels labels)
Returns aBound Instrument
associated with the specified labels.
-
-
-
Method Detail
-
bind
B bind(Labels labels)
Returns aBound Instrument
associated with the specified labels. Multiples requests with the same set of labels may return the sameBound Instrument
instance.It is recommended that callers keep a reference to the Bound Instrument instead of always calling this method for every operation.
- Parameters:
labels
- the set of labels, as key-value pairs.- Returns:
- a
Bound Instrument
- Throws:
NullPointerException
- iflabelValues
is null.
-
-