Class DropwizardExports
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.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class io.prometheus.metrics.instrumentation.dropwizard5.internal.AbstractDropwizardExports
invalidMetricHandler, labelMapper, metricFilter, registry -
Constructor Summary
ConstructorsConstructorDescriptionDropwizardExports(io.dropwizard.metrics5.MetricRegistry registry) Creates a new DropwizardExports withMetricFilter.ALL.DropwizardExports(io.dropwizard.metrics5.MetricRegistry registry, io.dropwizard.metrics5.MetricFilter metricFilter) Creates a new DropwizardExports with a customMetricFilter.DropwizardExports(io.dropwizard.metrics5.MetricRegistry registry, io.dropwizard.metrics5.MetricFilter metricFilter, CustomLabelMapper labelMapper) -
Method Summary
Modifier and TypeMethodDescriptionstatic DropwizardExports.Builderbuilder()protected io.prometheus.metrics.model.snapshots.MetricSnapshotsCollect all metric snapshots from the registry.protected doubleget75thPercentile(io.dropwizard.metrics5.Snapshot snapshot) protected doubleget95thPercentile(io.dropwizard.metrics5.Snapshot snapshot) protected doubleget98thPercentile(io.dropwizard.metrics5.Snapshot snapshot) protected doubleget999thPercentile(io.dropwizard.metrics5.Snapshot snapshot) protected doubleget99thPercentile(io.dropwizard.metrics5.Snapshot snapshot) protected longgetCounterCount(io.dropwizard.metrics5.Counter counter) protected ObjectgetGaugeValue(io.dropwizard.metrics5.Gauge<?> gauge) protected longgetHistogramCount(io.dropwizard.metrics5.Histogram histogram) protected io.dropwizard.metrics5.SnapshotgetHistogramSnapshot(io.dropwizard.metrics5.Histogram histogram) protected doublegetMedian(io.dropwizard.metrics5.Snapshot snapshot) protected longgetMeterCount(io.dropwizard.metrics5.Meter meter) protected longgetTimerCount(io.dropwizard.metrics5.Timer timer) protected io.dropwizard.metrics5.SnapshotgetTimerSnapshot(io.dropwizard.metrics5.Timer timer) Methods inherited from class io.prometheus.metrics.instrumentation.dropwizard5.internal.AbstractDropwizardExports
collect, collectMetricKind, fromCounter, fromGauge, fromHistogram, fromMeter, fromSnapshotAndCount, fromTimer, getHelpMessage, getMetricMetaDataMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.prometheus.metrics.model.registry.MultiCollector
collect, collect, collect, getLabelNames, getMetadata, getMetricType, getPrometheusNames
-
Constructor Details
-
DropwizardExports
public DropwizardExports(io.dropwizard.metrics5.MetricRegistry registry) Creates a new DropwizardExports withMetricFilter.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 customMetricFilter.- 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:AbstractDropwizardExportsCollect all metric snapshots from the registry.- Specified by:
collectMetricSnapshotsin classAbstractDropwizardExports<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:
getCounterCountin classAbstractDropwizardExports<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
- Specified by:
getGaugeValuein classAbstractDropwizardExports<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:
getHistogramSnapshotin classAbstractDropwizardExports<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:
getHistogramCountin classAbstractDropwizardExports<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:
getTimerSnapshotin classAbstractDropwizardExports<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:
getTimerCountin classAbstractDropwizardExports<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:
getMeterCountin classAbstractDropwizardExports<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:
getMedianin classAbstractDropwizardExports<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:
get75thPercentilein classAbstractDropwizardExports<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:
get95thPercentilein classAbstractDropwizardExports<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:
get98thPercentilein classAbstractDropwizardExports<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:
get99thPercentilein classAbstractDropwizardExports<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:
get999thPercentilein classAbstractDropwizardExports<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
-