public static class MicrometerOptions.Builder extends Object
MicrometerOptions
.Modifier and Type | Method and Description |
---|---|
MicrometerOptions |
build() |
MicrometerOptions.Builder |
disable()
Disable the latency collector.
|
MicrometerOptions.Builder |
enable()
Enable the latency collector.
|
MicrometerOptions.Builder |
enabledCommands(CommandType... commands)
Sets which commands are enabled for latency recording.
|
MicrometerOptions.Builder |
histogram(boolean histogram)
Enable histogram buckets used to generate aggregable percentile approximations in monitoring systems that have query
facilities to do so.
|
MicrometerOptions.Builder |
localDistinction(boolean localDistinction)
Enables per connection metrics tracking insead of per host/port.
|
MicrometerOptions.Builder |
maxLatency(Duration maxLatency)
Sets the maximum value that this timer is expected to observe.
|
MicrometerOptions.Builder |
metricsFilter(Predicate<RedisCommand<?,?,?>> filter)
Configures a filter
Predicate to filter which commands should be reported to Micrometer. |
MicrometerOptions.Builder |
minLatency(Duration minLatency)
Sets the minimum value that this timer is expected to observe.
|
MicrometerOptions.Builder |
tags(io.micrometer.core.instrument.Tags tags)
Extra tags to add to the generated metrics.
|
MicrometerOptions.Builder |
targetPercentiles(double[] targetPercentiles)
Sets the emitted percentiles.
|
public MicrometerOptions.Builder disable()
MicrometerOptions.Builder
.public MicrometerOptions.Builder enable()
MicrometerOptions.Builder
.public MicrometerOptions.Builder histogram(boolean histogram)
histogram
- true
if histogram buckets are recordedMicrometerOptions.Builder
.public MicrometerOptions.Builder localDistinction(boolean localDistinction)
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.localDistinction
- true
if latencies are recorded distinct on local level (per connection)MicrometerOptions.Builder
.public MicrometerOptions.Builder enabledCommands(CommandType... commands)
metricsFilter(Predicate)
.commands
- list of Redis commands that are enabled for latency recording, must not be null
MicrometerOptions.Builder
.public MicrometerOptions.Builder metricsFilter(Predicate<RedisCommand<?,?,?>> filter)
Predicate
to filter which commands should be reported to Micrometer.filter
- the filter predicate to test commands.MicrometerOptions.Builder
.public MicrometerOptions.Builder maxLatency(Duration maxLatency)
5m
. See MicrometerOptions.DEFAULT_MAX_LATENCY
.maxLatency
- the maximum value that this timer is expected to observe, must not be null
MicrometerOptions.Builder
.public MicrometerOptions.Builder minLatency(Duration minLatency)
1ms
. See MicrometerOptions.DEFAULT_MIN_LATENCY
.minLatency
- the minimum value that this timer is expected to observeMicrometerOptions.Builder
.public MicrometerOptions.Builder tags(io.micrometer.core.instrument.Tags tags)
Tags.empty()
.tags
- tags to add to the metricsMicrometerOptions.Builder
.public MicrometerOptions.Builder targetPercentiles(double[] targetPercentiles)
0.50, 0.90, 0.95, 0.99, 0.999
for the 50th, 90th, 95th, 99th, and
99th percentiles. Only applicable when histogram is enabled. See
MicrometerOptions.DEFAULT_TARGET_PERCENTILES
.targetPercentiles
- the percentiles which should be emitted, must not be null
MicrometerOptions.Builder
.public MicrometerOptions build()
MicrometerOptions
.Copyright © 2023 lettuce.io. All rights reserved.