Interface BoundDoubleUpDownCounter


@ThreadSafe public interface BoundDoubleUpDownCounter
A DoubleUpDownCounter bound to a fixed set of Attributes, obtained via ExtendedDoubleUpDownCounter.bind(Attributes).

Binding resolves the underlying timeseries once, so subsequent add(double) calls record directly without the per-recording attribute processing and map lookup that DoubleUpDownCounter.add(double, 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(double value)
    Records a value against the bound attributes.
    void
    add(double value, io.opentelemetry.context.Context context)
    Records a value against the bound attributes, with an explicit Context.
  • Method Details

    • add

      void add(double 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(double 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.