java.lang.Object
io.prometheus.metrics.instrumentation.dropwizard5.internal.AbstractDropwizardExports<io.dropwizard.metrics5.MetricRegistry,io.dropwizard.metrics5.MetricFilter,io.dropwizard.metrics5.Counter,io.dropwizard.metrics5.Gauge<?>,io.dropwizard.metrics5.Histogram,io.dropwizard.metrics5.Timer,io.dropwizard.metrics5.Meter,io.dropwizard.metrics5.Metric,io.dropwizard.metrics5.Snapshot>
io.prometheus.metrics.instrumentation.dropwizard5.DropwizardExports
All Implemented Interfaces:
io.prometheus.metrics.model.registry.MultiCollector

public class DropwizardExports extends AbstractDropwizardExports<io.dropwizard.metrics5.MetricRegistry,io.dropwizard.metrics5.MetricFilter,io.dropwizard.metrics5.Counter,io.dropwizard.metrics5.Gauge<?>,io.dropwizard.metrics5.Histogram,io.dropwizard.metrics5.Timer,io.dropwizard.metrics5.Meter,io.dropwizard.metrics5.Metric,io.dropwizard.metrics5.Snapshot>
Collect Dropwizard 5.x metrics from a MetricRegistry.

This is a thin wrapper around AbstractDropwizardExports that handles the Dropwizard 5.x specific API where metric names are MetricName objects.

  • Constructor Details

    • DropwizardExports

      public DropwizardExports(io.dropwizard.metrics5.MetricRegistry registry)
      Creates a new DropwizardExports with MetricFilter.ALL.
      Parameters:
      registry - a metric registry to export in prometheus.
    • DropwizardExports

      public DropwizardExports(io.dropwizard.metrics5.MetricRegistry registry, io.dropwizard.metrics5.MetricFilter metricFilter)
      Creates a new DropwizardExports with a custom MetricFilter.
      Parameters:
      registry - a metric registry to export in prometheus.
      metricFilter - a custom metric filter.
    • DropwizardExports

      public DropwizardExports(io.dropwizard.metrics5.MetricRegistry registry, io.dropwizard.metrics5.MetricFilter metricFilter, @Nullable CustomLabelMapper labelMapper)
      Parameters:
      registry - a metric registry to export in prometheus.
      metricFilter - a custom metric filter.
      labelMapper - a labelMapper to use to map labels.
  • Method Details

    • collectMetricSnapshots

      protected io.prometheus.metrics.model.snapshots.MetricSnapshots collectMetricSnapshots()
      Description copied from class: AbstractDropwizardExports
      Collect all metric snapshots from the registry.
      Specified by:
      collectMetricSnapshots in class AbstractDropwizardExports<io.dropwizard.metrics5.MetricRegistry,io.dropwizard.metrics5.MetricFilter,io.dropwizard.metrics5.Counter,io.dropwizard.metrics5.Gauge<?>,io.dropwizard.metrics5.Histogram,io.dropwizard.metrics5.Timer,io.dropwizard.metrics5.Meter,io.dropwizard.metrics5.Metric,io.dropwizard.metrics5.Snapshot>
    • getCounterCount

      protected long getCounterCount(io.dropwizard.metrics5.Counter counter)
      Specified by:
      getCounterCount in class AbstractDropwizardExports<io.dropwizard.metrics5.MetricRegistry,io.dropwizard.metrics5.MetricFilter,io.dropwizard.metrics5.Counter,io.dropwizard.metrics5.Gauge<?>,io.dropwizard.metrics5.Histogram,io.dropwizard.metrics5.Timer,io.dropwizard.metrics5.Meter,io.dropwizard.metrics5.Metric,io.dropwizard.metrics5.Snapshot>
    • getGaugeValue

      protected Object getGaugeValue(io.dropwizard.metrics5.Gauge<?> gauge)
      Specified by:
      getGaugeValue in class AbstractDropwizardExports<io.dropwizard.metrics5.MetricRegistry,io.dropwizard.metrics5.MetricFilter,io.dropwizard.metrics5.Counter,io.dropwizard.metrics5.Gauge<?>,io.dropwizard.metrics5.Histogram,io.dropwizard.metrics5.Timer,io.dropwizard.metrics5.Meter,io.dropwizard.metrics5.Metric,io.dropwizard.metrics5.Snapshot>
    • getHistogramSnapshot

      protected io.dropwizard.metrics5.Snapshot getHistogramSnapshot(io.dropwizard.metrics5.Histogram histogram)
      Specified by:
      getHistogramSnapshot in class AbstractDropwizardExports<io.dropwizard.metrics5.MetricRegistry,io.dropwizard.metrics5.MetricFilter,io.dropwizard.metrics5.Counter,io.dropwizard.metrics5.Gauge<?>,io.dropwizard.metrics5.Histogram,io.dropwizard.metrics5.Timer,io.dropwizard.metrics5.Meter,io.dropwizard.metrics5.Metric,io.dropwizard.metrics5.Snapshot>
    • getHistogramCount

      protected long getHistogramCount(io.dropwizard.metrics5.Histogram histogram)
      Specified by:
      getHistogramCount in class AbstractDropwizardExports<io.dropwizard.metrics5.MetricRegistry,io.dropwizard.metrics5.MetricFilter,io.dropwizard.metrics5.Counter,io.dropwizard.metrics5.Gauge<?>,io.dropwizard.metrics5.Histogram,io.dropwizard.metrics5.Timer,io.dropwizard.metrics5.Meter,io.dropwizard.metrics5.Metric,io.dropwizard.metrics5.Snapshot>
    • getTimerSnapshot

      protected io.dropwizard.metrics5.Snapshot getTimerSnapshot(io.dropwizard.metrics5.Timer timer)
      Specified by:
      getTimerSnapshot in class AbstractDropwizardExports<io.dropwizard.metrics5.MetricRegistry,io.dropwizard.metrics5.MetricFilter,io.dropwizard.metrics5.Counter,io.dropwizard.metrics5.Gauge<?>,io.dropwizard.metrics5.Histogram,io.dropwizard.metrics5.Timer,io.dropwizard.metrics5.Meter,io.dropwizard.metrics5.Metric,io.dropwizard.metrics5.Snapshot>
    • getTimerCount

      protected long getTimerCount(io.dropwizard.metrics5.Timer timer)
      Specified by:
      getTimerCount in class AbstractDropwizardExports<io.dropwizard.metrics5.MetricRegistry,io.dropwizard.metrics5.MetricFilter,io.dropwizard.metrics5.Counter,io.dropwizard.metrics5.Gauge<?>,io.dropwizard.metrics5.Histogram,io.dropwizard.metrics5.Timer,io.dropwizard.metrics5.Meter,io.dropwizard.metrics5.Metric,io.dropwizard.metrics5.Snapshot>
    • getMeterCount

      protected long getMeterCount(io.dropwizard.metrics5.Meter meter)
      Specified by:
      getMeterCount in class AbstractDropwizardExports<io.dropwizard.metrics5.MetricRegistry,io.dropwizard.metrics5.MetricFilter,io.dropwizard.metrics5.Counter,io.dropwizard.metrics5.Gauge<?>,io.dropwizard.metrics5.Histogram,io.dropwizard.metrics5.Timer,io.dropwizard.metrics5.Meter,io.dropwizard.metrics5.Metric,io.dropwizard.metrics5.Snapshot>
    • getMedian

      protected double getMedian(io.dropwizard.metrics5.Snapshot snapshot)
      Specified by:
      getMedian in class AbstractDropwizardExports<io.dropwizard.metrics5.MetricRegistry,io.dropwizard.metrics5.MetricFilter,io.dropwizard.metrics5.Counter,io.dropwizard.metrics5.Gauge<?>,io.dropwizard.metrics5.Histogram,io.dropwizard.metrics5.Timer,io.dropwizard.metrics5.Meter,io.dropwizard.metrics5.Metric,io.dropwizard.metrics5.Snapshot>
    • get75thPercentile

      protected double get75thPercentile(io.dropwizard.metrics5.Snapshot snapshot)
      Specified by:
      get75thPercentile in class AbstractDropwizardExports<io.dropwizard.metrics5.MetricRegistry,io.dropwizard.metrics5.MetricFilter,io.dropwizard.metrics5.Counter,io.dropwizard.metrics5.Gauge<?>,io.dropwizard.metrics5.Histogram,io.dropwizard.metrics5.Timer,io.dropwizard.metrics5.Meter,io.dropwizard.metrics5.Metric,io.dropwizard.metrics5.Snapshot>
    • get95thPercentile

      protected double get95thPercentile(io.dropwizard.metrics5.Snapshot snapshot)
      Specified by:
      get95thPercentile in class AbstractDropwizardExports<io.dropwizard.metrics5.MetricRegistry,io.dropwizard.metrics5.MetricFilter,io.dropwizard.metrics5.Counter,io.dropwizard.metrics5.Gauge<?>,io.dropwizard.metrics5.Histogram,io.dropwizard.metrics5.Timer,io.dropwizard.metrics5.Meter,io.dropwizard.metrics5.Metric,io.dropwizard.metrics5.Snapshot>
    • get98thPercentile

      protected double get98thPercentile(io.dropwizard.metrics5.Snapshot snapshot)
      Specified by:
      get98thPercentile in class AbstractDropwizardExports<io.dropwizard.metrics5.MetricRegistry,io.dropwizard.metrics5.MetricFilter,io.dropwizard.metrics5.Counter,io.dropwizard.metrics5.Gauge<?>,io.dropwizard.metrics5.Histogram,io.dropwizard.metrics5.Timer,io.dropwizard.metrics5.Meter,io.dropwizard.metrics5.Metric,io.dropwizard.metrics5.Snapshot>
    • get99thPercentile

      protected double get99thPercentile(io.dropwizard.metrics5.Snapshot snapshot)
      Specified by:
      get99thPercentile in class AbstractDropwizardExports<io.dropwizard.metrics5.MetricRegistry,io.dropwizard.metrics5.MetricFilter,io.dropwizard.metrics5.Counter,io.dropwizard.metrics5.Gauge<?>,io.dropwizard.metrics5.Histogram,io.dropwizard.metrics5.Timer,io.dropwizard.metrics5.Meter,io.dropwizard.metrics5.Metric,io.dropwizard.metrics5.Snapshot>
    • get999thPercentile

      protected double get999thPercentile(io.dropwizard.metrics5.Snapshot snapshot)
      Specified by:
      get999thPercentile in class AbstractDropwizardExports<io.dropwizard.metrics5.MetricRegistry,io.dropwizard.metrics5.MetricFilter,io.dropwizard.metrics5.Counter,io.dropwizard.metrics5.Gauge<?>,io.dropwizard.metrics5.Histogram,io.dropwizard.metrics5.Timer,io.dropwizard.metrics5.Meter,io.dropwizard.metrics5.Metric,io.dropwizard.metrics5.Snapshot>
    • builder

      public static DropwizardExports.Builder builder()