Interface BoundLongHistogram


@ThreadSafe public interface BoundLongHistogram
A LongHistogram bound to a fixed set of Attributes, obtained via ExtendedLongHistogram.bind(Attributes).

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

    • record

      void record(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 amount of the measurement. MUST be non-negative.
    • record

      void record(long value, io.opentelemetry.context.Context context)
      Records a value against the bound attributes, with an explicit Context.
      Parameters:
      value - The amount of the measurement. MUST be non-negative.
      context - The explicit context to associate with this measurement.