java.lang.Object
io.lettuce.core.metrics.MicrometerOptions.Builder
- Enclosing class:
- MicrometerOptions
public static class MicrometerOptions.Builder extends Object
Builder for
MicrometerOptions.-
Method Summary
Modifier and Type Method Description MicrometerOptionsbuild()MicrometerOptions.Builderdisable()Disable the latency collector.MicrometerOptions.Builderenable()Enable the latency collector.MicrometerOptions.Builderhistogram(boolean histogram)Enable histogram buckets used to generate aggregable percentile approximations in monitoring systems that have query facilities to do so.MicrometerOptions.BuilderlocalDistinction(boolean localDistinction)Enables per connection metrics tracking insead of per host/port.MicrometerOptions.BuildermaxLatency(Duration maxLatency)Sets the maximum value that this timer is expected to observe.MicrometerOptions.BuilderminLatency(Duration minLatency)Sets the minimum value that this timer is expected to observe.MicrometerOptions.Buildertags(io.micrometer.core.instrument.Tags tags)Extra tags to add to the generated metrics.MicrometerOptions.BuildertargetPercentiles(double[] targetPercentiles)Sets the emitted percentiles.
-
Method Details
-
disable
Disable the latency collector.- Returns:
- this
MicrometerOptions.Builder.
-
enable
Enable the latency collector.- Returns:
- this
MicrometerOptions.Builder.
-
histogram
Enable histogram buckets used to generate aggregable percentile approximations in monitoring systems that have query facilities to do so.- Parameters:
histogram-trueif histogram buckets are recorded- Returns:
- this
MicrometerOptions.Builder.
-
localDistinction
Enables per connection metrics tracking insead of per host/port. Iftrue, multiple connections to the same host/connection point will be recorded separately which allows to inspect every connection individually. Iffalse, multiple connections to the same host/connection point will be recorded together. This allows a consolidated view on one particular service. Defaults tofalse. SeeMicrometerOptions.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-trueif latencies are recorded distinct on local level (per connection)- Returns:
- this
MicrometerOptions.Builder.
-
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 to5m. SeeMicrometerOptions.DEFAULT_MAX_LATENCY.- Parameters:
maxLatency- The maximum value that this timer is expected to observe- Returns:
- this
MicrometerOptions.Builder.
-
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 to1ms. SeeMicrometerOptions.DEFAULT_MIN_LATENCY.- Parameters:
minLatency- The minimum value that this timer is expected to observe- Returns:
- this
MicrometerOptions.Builder.
-
tags
Extra tags to add to the generated metrics. Defaults toTags.empty().- Parameters:
tags- Tags to add to the metrics- Returns:
- this
MicrometerOptions.Builder.
-
targetPercentiles
Sets the emitted percentiles. Defaults to 0.50, 0.90, 0.95, 0.99, 0.999}. Only applicable when histogram is enabled. SeeMicrometerOptions.DEFAULT_TARGET_PERCENTILES.- Parameters:
targetPercentiles- the percentiles which should be emitted, must not benull- Returns:
- this
MicrometerOptions.Builder.
-
build
- Returns:
- a new instance of
MicrometerOptions.
-