Package io.micrometer.core.instrument
Class LongTaskTimer.Builder
java.lang.Object
io.micrometer.core.instrument.LongTaskTimer.Builder
- Enclosing interface:
LongTaskTimer
Fluent builder for long task timers.
-
Method Summary
Modifier and TypeMethodDescriptiondescription
(String description) distributionStatisticBufferLength
(Integer bufferLength) Statistics emanating from a timer like max, percentiles, and histogram counts decay over time to give greater weight to recent samples (exception: histogram counts are cumulative for those systems that expect cumulative histogram buckets).distributionStatisticExpiry
(Duration expiry) Statistics emanating from a timer like max, percentiles, and histogram counts decay over time to give greater weight to recent samples (exception: histogram counts are cumulative for those systems that expect cumulative histogram buckets).Sets the maximum value that this timer is expected to observe.Sets the minimum value that this timer is expected to observe.percentilePrecision
(Integer digitsOfPrecision) Determines the number of digits of precision to maintain on the dynamic range histogram used to compute percentile approximations.Adds histogram buckets used to generate aggregable percentile approximations in monitoring systems that have query facilities to do so (e.g.publishPercentileHistogram
(Boolean enabled) Adds histogram buckets used to generate aggregable percentile approximations in monitoring systems that have query facilities to do so (e.g.publishPercentiles
(double... percentiles) Produces an additional time series for each requested percentile.register
(MeterRegistry registry) Add the long task timer to a single registry, or return an existing long task timer in that registry.serviceLevelObjectives
(Duration... slos) Publish at a minimum a histogram containing your defined service level objective (SLO) boundaries.withRegistry
(MeterRegistry registry) Convenience method to create meters from the builder that only differ in tags.
-
Method Details
-
tags
- Parameters:
tags
- Must be an even number of arguments representing key/value pairs of tags.- Returns:
- The long task timer builder with added tags.
-
tags
- Parameters:
tags
- Tags to add to the eventual long task timer.- Returns:
- The long task timer builder with added tags.
-
tag
- Parameters:
key
- The tag key.value
- The tag value.- Returns:
- The long task timer builder with a single added tag.
-
description
- Parameters:
description
- Description text of the eventual long task timer.- Returns:
- The long task timer builder with added description.
-
serviceLevelObjectives
Publish at a minimum a histogram containing your defined service level objective (SLO) boundaries. When used in conjunction withpublishPercentileHistogram()
, the boundaries defined here are included alongside other buckets used to generate aggregable percentile approximations.- Parameters:
slos
- Publish SLO boundaries in the set of histogram buckets shipped to the monitoring system.- Returns:
- This builder.
- Since:
- 1.5.0
-
minimumExpectedValue
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.- Parameters:
min
- The minimum value that this timer is expected to observe.- Returns:
- This builder.
- Since:
- 1.5.0
-
maximumExpectedValue
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.- Parameters:
max
- The maximum value that this timer is expected to observe.- Returns:
- This builder.
- Since:
- 1.5.0
-
distributionStatisticExpiry
Statistics emanating from a timer like max, percentiles, and histogram counts decay over time to give greater weight to recent samples (exception: histogram counts are cumulative for those systems that expect cumulative histogram buckets). Samples are accumulated to such statistics in ring buffers which rotate after this expiry, with a buffer length ofdistributionStatisticBufferLength(Integer)
.- Parameters:
expiry
- The amount of time samples are accumulated to a histogram before it is reset and rotated.- Returns:
- This builder.
- Since:
- 1.5.0
-
distributionStatisticBufferLength
Statistics emanating from a timer like max, percentiles, and histogram counts decay over time to give greater weight to recent samples (exception: histogram counts are cumulative for those systems that expect cumulative histogram buckets). Samples are accumulated to such statistics in ring buffers which rotate afterdistributionStatisticExpiry(Duration)
, with this buffer length.- Parameters:
bufferLength
- The number of histograms to keep in the ring buffer.- Returns:
- This builder.
- Since:
- 1.5.0
-
publishPercentiles
Produces an additional time series for each requested percentile. This percentile is computed locally, and so can't be aggregated with percentiles computed across other dimensions (e.g. in a different instance). UsepublishPercentileHistogram()
to publish a histogram that can be used to generate aggregable percentile approximations.- Parameters:
percentiles
- Percentiles to compute and publish. The 95th percentile should be expressed as0.95
.- Returns:
- This builder.
- Since:
- 1.5.0
-
percentilePrecision
Determines the number of digits of precision to maintain on the dynamic range histogram used to compute percentile approximations. The higher the degrees of precision, the more accurate the approximation is at the cost of more memory.- Parameters:
digitsOfPrecision
- The digits of precision to maintain for percentile approximations.- Returns:
- This builder.
- Since:
- 1.5.0
-
publishPercentileHistogram
Adds histogram buckets used to generate aggregable percentile approximations in monitoring systems that have query facilities to do so (e.g. Prometheus'histogram_quantile
, Atlas':percentiles
).- Returns:
- This builder.
- Since:
- 1.5.0
-
publishPercentileHistogram
Adds histogram buckets used to generate aggregable percentile approximations in monitoring systems that have query facilities to do so (e.g. Prometheus'histogram_quantile
, Atlas':percentiles
).- Parameters:
enabled
- Determines whether percentile histograms should be published.- Returns:
- This builder.
- Since:
- 1.5.0
-
withRegistry
Convenience method to create meters from the builder that only differ in tags. This method can be used for dynamic tagging by creating the builder once and applying the dynamically changing tags using the returnedMeter.MeterProvider
.- Parameters:
registry
- A registry to add the meter to, if it doesn't already exist.- Returns:
- A
Meter.MeterProvider
that returns a meter based on the provided tags. - Since:
- 1.12.0
-
register
Add the long task timer to a single registry, or return an existing long task timer in that registry. The returned long task timer will be unique for each registry, but each registry is guaranteed to only create one long task timer for the same combination of name and tags.- Parameters:
registry
- A registry to add the long task timer to, if it doesn't already exist.- Returns:
- A new or existing long task timer.
-