Class InfluxDbReporter

  • All Implemented Interfaces:
    io.dropwizard.metrics5.Reporter, Closeable, AutoCloseable

    public class InfluxDbReporter
    extends io.dropwizard.metrics5.ScheduledReporter
    A reporter which publishes metric values to InfluxDB.

    Metrics are reported according to the InfluxDB Line Protocol. Brief line protocol syntax as follows:

     measurement(,tag_key=tag_val)* field_key=field_val(,field_key_n=field_value_n)* (nanoseconds-timestamp)?
     

    This InfluxDB reporter is "garbage free" in steady state. This means objects and buffers are reused and no temporary objects are allocated as much as possible.

    • Constructor Detail

      • InfluxDbReporter

        public InfluxDbReporter​(io.dropwizard.metrics5.MetricRegistry registry,
                                InfluxDbSender sender,
                                io.dropwizard.metrics5.Clock clock,
                                io.dropwizard.metrics5.MetricName prefix,
                                TimeUnit rateUnit,
                                TimeUnit durationUnit,
                                io.dropwizard.metrics5.MetricFilter filter,
                                ScheduledExecutorService executor,
                                boolean shutdownExecutorOnStop,
                                Set<io.dropwizard.metrics5.MetricAttribute> disabledMetricAttributes)
        Creates a new InfluxDbReporter instance.
        Parameters:
        registry - the MetricRegistry containing the metrics this reporter will report
        sender - the InfluxDbSender which is responsible for sending metrics to a influxdb server via a transport protocol
        clock - the instance of the time. Use Clock.defaultClock() for the default
        prefix - the prefix of all metric names (may be null)
        rateUnit - the time unit of in which rates will be converted
        durationUnit - the time unit of in which durations will be converted
        filter - the filter for which metrics to report
        executor - 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
        disabledMetricAttributes - the disable metric attributes
    • Method Detail

      • report

        public void report​(SortedMap<io.dropwizard.metrics5.MetricName,​io.dropwizard.metrics5.Gauge<?>> gauges,
                           SortedMap<io.dropwizard.metrics5.MetricName,​io.dropwizard.metrics5.Counter> counters,
                           SortedMap<io.dropwizard.metrics5.MetricName,​io.dropwizard.metrics5.Histogram> histograms,
                           SortedMap<io.dropwizard.metrics5.MetricName,​io.dropwizard.metrics5.Meter> meters,
                           SortedMap<io.dropwizard.metrics5.MetricName,​io.dropwizard.metrics5.Timer> timers)
        Specified by:
        report in class io.dropwizard.metrics5.ScheduledReporter
      • stop

        public void stop()
      • report

        public void report()
        Overrides:
        report in class io.dropwizard.metrics5.ScheduledReporter