Interface DoubleGaugeBuilder


  • public interface DoubleGaugeBuilder
    A builder for Gauge metric types. These can only be asynchronously collected.
    • Method Detail

      • setDescription

        DoubleGaugeBuilder setDescription​(String description)
        Sets the description for this instrument.

        Description strings should follow the instrument description rules: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#instrument-description

      • setUnit

        DoubleGaugeBuilder setUnit​(String unit)
        Sets the unit of measure for this instrument.

        Unit strings should follow the instrument unit rules: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#instrument-unit

      • buildWithCallback

        void buildWithCallback​(Consumer<ObservableDoubleMeasurement> callback)
        Builds this asynchronous instrument with the given callback.

        The callback will only be called when the Meter is being observed.

        Parameters:
        callback - A state-capturing callback used to observe values on-demand.