Interface DoubleGauge


@ThreadSafe public interface DoubleGauge
A gauge instrument that synchronously records double values.
Since:
1.38.0
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Returns true if the gauge is enabled.
    void
    set(double value)
    Set the gauge value.
    void
    set(double value, Attributes attributes)
    Records a value with a set of attributes.
    void
    set(double value, Attributes attributes, io.opentelemetry.context.Context context)
    Records a value with a set of attributes.
  • Method Details

    • isEnabled

      default boolean isEnabled()
      Returns true if the gauge is enabled.

      This allows callers to avoid unnecessary compute when nothing is consuming the data. Because the response is subject to change over the application, callers should call this before each call to set(double), set(double, Attributes), or set(double, Attributes, Context).

      Since:
      1.61.0
    • set

      void set(double value)
      Set the gauge value.
      Parameters:
      value - The current gauge value.
    • set

      void set(double value, Attributes attributes)
      Records a value with a set of attributes.
      Parameters:
      value - The current gauge value.
      attributes - A set of attributes to associate with the value.
    • set

      void set(double value, Attributes attributes, io.opentelemetry.context.Context context)
      Records a value with a set of attributes.
      Parameters:
      value - The current gauge value.
      attributes - A set of attributes to associate with the value.
      context - The explicit context to associate with this measurement.