Package org.dhatim.dropwizard.prometheus
Class PrometheusReporter
- java.lang.Object
-
- com.codahale.metrics.ScheduledReporter
-
- org.dhatim.dropwizard.prometheus.PrometheusReporter
-
- All Implemented Interfaces:
com.codahale.metrics.Reporter,Closeable,AutoCloseable
public class PrometheusReporter extends com.codahale.metrics.ScheduledReporter
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPrometheusReporter.BuilderA builder forPrometheusReporterinstances.
-
Constructor Summary
Constructors Modifier Constructor Description protectedPrometheusReporter(com.codahale.metrics.MetricRegistry registry, PrometheusSender prometheus, String prefix, com.codahale.metrics.MetricFilter filter, ScheduledExecutorService executor, boolean shutdownExecutorOnStop)Creates a newPrometheusReporterinstance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PrometheusReporter.BuilderforRegistry(com.codahale.metrics.MetricRegistry registry)Returns a newPrometheusReporter.BuilderforPrometheusReporter.voidreport(SortedMap<String,com.codahale.metrics.Gauge> gauges, SortedMap<String,com.codahale.metrics.Counter> counters, SortedMap<String,com.codahale.metrics.Histogram> histograms, SortedMap<String,com.codahale.metrics.Meter> meters, SortedMap<String,com.codahale.metrics.Timer> timers)voidstop()
-
-
-
Constructor Detail
-
PrometheusReporter
protected PrometheusReporter(com.codahale.metrics.MetricRegistry registry, PrometheusSender prometheus, String prefix, com.codahale.metrics.MetricFilter filter, ScheduledExecutorService executor, boolean shutdownExecutorOnStop)Creates a newPrometheusReporterinstance.- Parameters:
registry- theMetricRegistrycontaining the metrics this reporter will reportprometheus- thePrometheusSenderwhich is responsible for sending metrics to a Carbon server via a transport protocolprefix- the prefix of all metric names (may be null)filter- the filter for which metrics to reportexecutor- the executor to use while scheduling reporting of metrics (may be null).shutdownExecutorOnStop- if true, then executor will be stopped in same time with this reporter
-
-
Method Detail
-
stop
public void stop()
- Overrides:
stopin classcom.codahale.metrics.ScheduledReporter
-
report
public void report(SortedMap<String,com.codahale.metrics.Gauge> gauges, SortedMap<String,com.codahale.metrics.Counter> counters, SortedMap<String,com.codahale.metrics.Histogram> histograms, SortedMap<String,com.codahale.metrics.Meter> meters, SortedMap<String,com.codahale.metrics.Timer> timers)
- Specified by:
reportin classcom.codahale.metrics.ScheduledReporter
-
forRegistry
public static PrometheusReporter.Builder forRegistry(com.codahale.metrics.MetricRegistry registry)
Returns a newPrometheusReporter.BuilderforPrometheusReporter.- Parameters:
registry- the registry to report- Returns:
- a
PrometheusReporter.Builderinstance for aPrometheusReporter
-
-