Class ElasticsearchReporter.Builder

  • Enclosing class:
    ElasticsearchReporter

    public static class ElasticsearchReporter.Builder
    extends java.lang.Object
    • Method Detail

      • withClock

        public ElasticsearchReporter.Builder withClock​(com.codahale.metrics.Clock clock)
        Inject your custom definition of how time passes. Usually the default clock is sufficient
      • prefixedWith

        public ElasticsearchReporter.Builder prefixedWith​(java.lang.String prefix)
        Configure a prefix for each metric name. Optional, but useful to identify single hosts
      • convertRatesTo

        public ElasticsearchReporter.Builder convertRatesTo​(java.util.concurrent.TimeUnit rateUnit)
        Convert all the rates to a certain timeunit, defaults to seconds
      • convertDurationsTo

        public ElasticsearchReporter.Builder convertDurationsTo​(java.util.concurrent.TimeUnit durationUnit)
        Convert all the durations to a certain timeunit, defaults to milliseconds
      • filter

        public ElasticsearchReporter.Builder filter​(com.codahale.metrics.MetricFilter filter)
        Allows to configure a special MetricFilter, which defines what metrics are reported
      • hosts

        public ElasticsearchReporter.Builder hosts​(java.lang.String... hosts)
        Configure an array of hosts to send data to. Note: Data is always sent to only one host, but this makes sure, that even if a part of your elasticsearch cluster is not running, reporting still happens A host must be in the format hostname:port The port must be the HTTP port of your elasticsearch instance
      • timeout

        public ElasticsearchReporter.Builder timeout​(int timeout)
        The timeout to wait for until a connection attempt is and the next host is tried
      • indexDateFormat

        public ElasticsearchReporter.Builder indexDateFormat​(java.lang.String indexDateFormat)
        The index date format used for rolling indices This is appended to the index name, split by a '-'
      • bulkSize

        public ElasticsearchReporter.Builder bulkSize​(int bulkSize)
        The bulk size per request, defaults to 2500 (as metrics are quite small)
      • percolationFilter

        public ElasticsearchReporter.Builder percolationFilter​(com.codahale.metrics.MetricFilter percolationFilter)
        A metrics filter to define the metrics which should be used for percolation/notification
      • percolationNotifier

        public ElasticsearchReporter.Builder percolationNotifier​(Notifier notifier)
        An instance of the notifier implemention which should be executed in case of a matching percolation
      • timestampFieldname

        public ElasticsearchReporter.Builder timestampFieldname​(java.lang.String fieldName)
        Configure the name of the timestamp field, defaults to '@timestamp'
      • additionalFields

        public ElasticsearchReporter.Builder additionalFields​(java.util.Map<java.lang.String,​?> additionalFields)
        Additional fields to be included for each metric
        Parameters:
        additionalFields -
        Returns: