Interface BoundLongUpDownCounter


@ThreadSafe public interface BoundLongUpDownCounter
A LongUpDownCounter bound to a fixed set of Attributes, obtained via ExtendedLongUpDownCounter.bind(Attributes).

Binding resolves the underlying timeseries once, so subsequent add(long) calls record directly without the per-recording attribute processing and map lookup that LongUpDownCounter.add(long, Attributes) performs. This is useful when the set of attribute combinations is known ahead of time and the same series is recorded to repeatedly.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(long value)
    Records a value against the bound attributes.
    void
    add(long value, io.opentelemetry.context.Context context)
    Records a value against the bound attributes, with an explicit Context.
  • Method Details

    • add

      void add(long value)
      Records a value against the bound attributes.

      Note: This may use Context.current() to pull the context associated with this measurement.

      Parameters:
      value - The increment amount. May be positive, negative or zero.
    • add

      void add(long value, io.opentelemetry.context.Context context)
      Records a value against the bound attributes, with an explicit Context.
      Parameters:
      value - The increment amount. May be positive, negative or zero.
      context - The explicit context to associate with this measurement.