io.prometheus.metrics.config.ExemplarsProperties Maven / Gradle / Ivy
Show all versions of jmx_prometheus_httpserver Show documentation
package io.prometheus.metrics.config;
import java.util.Map;
/**
* Properties starting with io.prometheus.exemplars
*/
public class ExemplarsProperties {
private static final String MIN_RETENTION_PERIOD_SECONDS = "minRetentionPeriodSeconds";
private static final String MAX_RETENTION_PERIOD_SECONDS = "maxRetentionPeriodSeconds";
private static final String SAMPLE_INTERVAL_MILLISECONDS = "sampleIntervalMilliseconds";
private final Integer minRetentionPeriodSeconds;
private final Integer maxRetentionPeriodSeconds;
private final Integer sampleIntervalMilliseconds;
private ExemplarsProperties(
Integer minRetentionPeriodSeconds,
Integer maxRetentionPeriodSeconds,
Integer sampleIntervalMilliseconds) {
this.minRetentionPeriodSeconds = minRetentionPeriodSeconds;
this.maxRetentionPeriodSeconds = maxRetentionPeriodSeconds;
this.sampleIntervalMilliseconds = sampleIntervalMilliseconds;
}
/**
* Minimum time how long Exemplars are kept before they may be replaced by new Exemplars.
*
* Default see {@code ExemplarSamplerConfig.DEFAULT_MIN_RETENTION_PERIOD_SECONDS}
*/
public Integer getMinRetentionPeriodSeconds() {
return minRetentionPeriodSeconds;
}
/**
* Maximum time how long Exemplars are kept before they are evicted.
*
* Default see {@code ExemplarSamplerConfig.DEFAULT_MAX_RETENTION_PERIOD_SECONDS}
*/
public Integer getMaxRetentionPeriodSeconds() {
return maxRetentionPeriodSeconds;
}
/**
* Time between attempts to sample new Exemplars. This is a performance improvement for high-frequency
* applications, because with the sample interval we make sure that the exemplar sampler is not called
* for every single request.
*
* Default see {@code ExemplarSamplerConfig.DEFAULT_SAMPLE_INTERVAL_MILLISECONDS}
*/
public Integer getSampleIntervalMilliseconds() {
return sampleIntervalMilliseconds;
}
/**
* Note that this will remove entries from {@code properties}.
* This is because we want to know if there are unused properties remaining after all properties have been loaded.
*/
static ExemplarsProperties load(String prefix, Map