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 Detail

      • bind

        B bind​(Labels labels)
        Returns a Bound Instrument associated with the specified labels. Multiples requests with the same set of labels may return the same Bound 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 - if labelValues is null.