Class RHDropwizardExports

java.lang.Object
io.prometheus.client.Collector
org.restheart.metrics.RHDropwizardExports
All Implemented Interfaces:
io.prometheus.client.Collector.Describable

public class RHDropwizardExports extends io.prometheus.client.Collector implements io.prometheus.client.Collector.Describable
Collect Dropwizard metrics from a MetricRegistry. Modified from https://github.com/prometheus/client_java/blob/main/simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/DropwizardExports.java to track additional timer metrics and to handle metric name as MetricNameAndLabels
  • Nested Class Summary

    Nested classes/interfaces inherited from class io.prometheus.client.Collector

    io.prometheus.client.Collector.Describable, io.prometheus.client.Collector.MetricFamilySamples, io.prometheus.client.Collector.Type
  • Field Summary

    Fields inherited from class io.prometheus.client.Collector

    MILLISECONDS_PER_SECOND, NANOSECONDS_PER_SECOND
  • Constructor Summary

    Constructors
    Constructor
    Description
    RHDropwizardExports(com.codahale.metrics.MetricRegistry registry)
    Creates a new DropwizardExports with a DefaultSampleBuilder and MetricFilter.ALL.
    Creates a new DropwizardExports with a DefaultSampleBuilder and MetricFilter.ALL.
  • Method Summary

    Modifier and Type
    Method
    Description
    List<io.prometheus.client.Collector.MetricFamilySamples>
     
    List<io.prometheus.client.Collector.MetricFamilySamples>
     

    Methods inherited from class io.prometheus.client.Collector

    checkMetricLabelName, checkMetricName, collect, doubleToGoString, register, register, sanitizeMetricName

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RHDropwizardExports

      public RHDropwizardExports(String registryName)
      Creates a new DropwizardExports with a DefaultSampleBuilder and MetricFilter.ALL.
      Parameters:
      registry - a metric registry to export in prometheus.
    • RHDropwizardExports

      public RHDropwizardExports(com.codahale.metrics.MetricRegistry registry)
      Creates a new DropwizardExports with a DefaultSampleBuilder and MetricFilter.ALL.
      Parameters:
      registry - a metric registry to export in prometheus.
  • Method Details

    • collect

      public List<io.prometheus.client.Collector.MetricFamilySamples> collect()
      Specified by:
      collect in class io.prometheus.client.Collector
    • describe

      public List<io.prometheus.client.Collector.MetricFamilySamples> describe()
      Specified by:
      describe in interface io.prometheus.client.Collector.Describable