Module lettuce.core

Class MicrometerOptions.Builder

java.lang.Object
io.lettuce.core.metrics.MicrometerOptions.Builder
Enclosing class:
MicrometerOptions

public static class MicrometerOptions.Builder
extends Object
Builder for MicrometerOptions.
  • Method Details

    • disable

      public MicrometerOptions.Builder disable()
      Disable the latency collector.
      Returns:
      this MicrometerOptions.Builder.
    • enable

      public MicrometerOptions.Builder enable()
      Enable the latency collector.
      Returns:
      this MicrometerOptions.Builder.
    • histogram

      public MicrometerOptions.Builder histogram​(boolean histogram)
      Enable histogram buckets used to generate aggregable percentile approximations in monitoring systems that have query facilities to do so.
      Parameters:
      histogram - true if histogram buckets are recorded
      Returns:
      this MicrometerOptions.Builder.
    • localDistinction

      public MicrometerOptions.Builder localDistinction​(boolean localDistinction)
      Enables per connection metrics tracking insead of per host/port. If true, multiple connections to the same host/connection point will be recorded separately which allows to inspect every connection individually. If false, multiple connections to the same host/connection point will be recorded together. This allows a consolidated view on one particular service. Defaults to false. See MicrometerOptions.DEFAULT_LOCAL_DISTINCTION. Warning: Enabling this could potentially cause a label cardinality explosion in the remote metric system and should be used with caution.
      Parameters:
      localDistinction - true if latencies are recorded distinct on local level (per connection)
      Returns:
      this MicrometerOptions.Builder.
    • maxLatency

      public MicrometerOptions.Builder maxLatency​(Duration maxLatency)
      Sets the maximum value that this timer is expected to observe. Sets an upper bound on histogram buckets that are shipped to monitoring systems that support aggregable percentile approximations. Only applicable when histogram is enabled. Defaults to 5m. See MicrometerOptions.DEFAULT_MAX_LATENCY.
      Parameters:
      maxLatency - The maximum value that this timer is expected to observe
      Returns:
      this MicrometerOptions.Builder.
    • minLatency

      public MicrometerOptions.Builder minLatency​(Duration minLatency)
      Sets the minimum value that this timer is expected to observe. Sets a lower bound on histogram buckets that are shipped to monitoring systems that support aggregable percentile approximations. Only applicable when histogram is enabled. Defaults to 1ms. See MicrometerOptions.DEFAULT_MIN_LATENCY.
      Parameters:
      minLatency - The minimum value that this timer is expected to observe
      Returns:
      this MicrometerOptions.Builder.
    • tags

      public MicrometerOptions.Builder tags​(io.micrometer.core.instrument.Tags tags)
      Extra tags to add to the generated metrics. Defaults to Tags.empty().
      Parameters:
      tags - Tags to add to the metrics
      Returns:
      this MicrometerOptions.Builder.
    • targetPercentiles

      public MicrometerOptions.Builder targetPercentiles​(double[] targetPercentiles)
      Sets the emitted percentiles. Defaults to 0.50, 0.90, 0.95, 0.99, 0.999}. Only applicable when histogram is enabled. See MicrometerOptions.DEFAULT_TARGET_PERCENTILES.
      Parameters:
      targetPercentiles - the percentiles which should be emitted, must not be null
      Returns:
      this MicrometerOptions.Builder.
    • build

      public MicrometerOptions build()
      Returns:
      a new instance of MicrometerOptions.