Interface MetricsRegistry

All Superinterfaces:
AutoCloseable, Closeable
All Known Subinterfaces:
MetricsTelemetry
All Known Implementing Classes:
NoopMetricsRegistry

@ExperimentalApi public interface MetricsRegistry extends Closeable
MetricsRegistry helps in creating the metric instruments.
Opensearch.experimental:
  • Method Details

    • createCounter

      Counter createCounter(String name, String description, String unit)
      Creates the counter.
      Parameters:
      name - name of the counter.
      description - any description about the metric.
      unit - unit of the metric.
      Returns:
      counter.
    • createUpDownCounter

      Counter createUpDownCounter(String name, String description, String unit)
      Creates the upDown counter.
      Parameters:
      name - name of the upDown counter.
      description - any description about the metric.
      unit - unit of the metric.
      Returns:
      counter.
    • createHistogram

      Histogram createHistogram(String name, String description, String unit)
      Creates the histogram type of Metric. Implementation framework will take care of the bucketing strategy.
      Parameters:
      name - name of the histogram.
      description - any description about the metric.
      unit - unit of the metric.
      Returns:
      histogram.
    • createGauge

      Closeable createGauge(String name, String description, String unit, Supplier<Double> valueProvider, Tags tags)
      Creates the Observable Gauge type of Metric. Where the value provider will be called at a certain frequency to capture the value.
      Parameters:
      name - name of the observable gauge.
      description - any description about the metric.
      unit - unit of the metric.
      valueProvider - value provider.
      tags - attributes/dimensions of the metric.
      Returns:
      closeable to dispose/close the Gauge metric.
    • createGauge

      Closeable createGauge(String name, String description, String unit, Supplier<TaggedMeasurement> value)
      Creates the Observable Gauge type of Metric. Where the value provider will be called at a certain frequency to capture the value.
      Parameters:
      name - name of the observable gauge.
      description - any description about the metric.
      unit - unit of the metric.
      value - value provider.
      Returns:
      closeable to dispose/close the Gauge metric.