java.lang.Object
io.prometheus.metrics.core.metrics.Metric.Builder<B,M>
io.prometheus.metrics.core.metrics.MetricWithFixedMetadata.Builder<B,M>
io.prometheus.metrics.core.metrics.Summary.Builder
- Enclosing class:
- Summary
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final long5 minutes.static final int5.protected BooleanFields inherited from class io.prometheus.metrics.core.metrics.MetricWithFixedMetadata.Builder
nameFields inherited from class io.prometheus.metrics.core.metrics.Metric.Builder
constLabels, illegalLabelNames, properties -
Method Summary
Modifier and TypeMethodDescriptionbuild()io.prometheus.metrics.config.MetricsPropertiesDefault properties for summary metrics.maxAgeSeconds(long maxAgeSeconds) The quantiles are relative to a moving time window.numberOfAgeBuckets(int ageBuckets) The quantiles are relative to a moving time window.quantile(double quantile) Add a quantile.quantile(double quantile, double error) Add a quantile.protected Summary.Builderself()protected io.prometheus.metrics.config.MetricsPropertiesOverride if there are more properties than just exemplars enabled.Allow Exemplars for this metric.Turn off Exemplars for this metric.Methods inherited from class io.prometheus.metrics.core.metrics.MetricWithFixedMetadata.Builder
constLabels, help, labelNames, name, unitMethods inherited from class io.prometheus.metrics.core.metrics.Metric.Builder
register, register
-
Field Details
-
DEFAULT_MAX_AGE_SECONDS
public static final long DEFAULT_MAX_AGE_SECONDS5 minutes. SeemaxAgeSeconds(long). -
DEFAULT_NUMBER_OF_AGE_BUCKETS
public static final int DEFAULT_NUMBER_OF_AGE_BUCKETS5. SeenumberOfAgeBuckets(int)- See Also:
-
exemplarsEnabled
-
-
Method Details
-
quantile
Add a quantile. Seequantile(double, double).Default errors are:
- error = 0.001 if quantile <= 0.01 or quantile >= 0.99
- error = 0.005 if quantile <= 0.02 or quantile >= 0.98
- error = 0.01 else.
-
quantile
Add a quantile. Call multiple times to add multiple quantiles.Example: The following will track the 0.95 quantile:
The second argument is the acceptable error margin, i.e. with the code above the quantile will not be exactly the 0.95 quantile but something between 0.949 and 0.951..quantile(0.95, 0.001)There are two special cases:
.quantile(0.0, 0.0)gives you the minimum observed value.quantile(1.0, 0.0)gives you the maximum observed value
-
maxAgeSeconds
The quantiles are relative to a moving time window.maxAgeSecondsis the size of that time window. Default isDEFAULT_MAX_AGE_SECONDS. -
numberOfAgeBuckets
The quantiles are relative to a moving time window. ThenumberOfAgeBucketsdefines how smoothly the time window moves forward. For example, if the time window is 5 minutes and has 5 age buckets, then it is moving forward every minute by one minute. Default isDEFAULT_NUMBER_OF_AGE_BUCKETS. -
toProperties
protected io.prometheus.metrics.config.MetricsProperties toProperties()Override if there are more properties than just exemplars enabled. -
getDefaultProperties
public io.prometheus.metrics.config.MetricsProperties getDefaultProperties()Default properties for summary metrics. -
build
- Specified by:
buildin classMetricWithFixedMetadata.Builder<Summary.Builder,Summary>
-
self
- Specified by:
selfin classMetricWithFixedMetadata.Builder<Summary.Builder,Summary>
-
withExemplars
Allow Exemplars for this metric. -
withoutExemplars
Turn off Exemplars for this metric.
-