Class ExemplarSamplerConfig

java.lang.Object
io.prometheus.metrics.core.exemplars.ExemplarSamplerConfig

public class ExemplarSamplerConfig extends Object
  • Field Details

    • DEFAULT_MIN_RETENTION_PERIOD_SECONDS

      public static final int DEFAULT_MIN_RETENTION_PERIOD_SECONDS
      See ExemplarsProperties.getMinRetentionPeriodSeconds()
      See Also:
    • DEFAULT_MAX_RETENTION_PERIOD_SECONDS

      public static final int DEFAULT_MAX_RETENTION_PERIOD_SECONDS
      See ExemplarsProperties.getMaxRetentionPeriodSeconds()
      See Also:
  • Constructor Details

    • ExemplarSamplerConfig

      public ExemplarSamplerConfig(io.prometheus.metrics.config.ExemplarsProperties properties, int numberOfExemplars)
      Constructor for all metric types except classic histograms.
      Parameters:
      properties - See PrometheusProperties.getExemplarProperties().
      numberOfExemplars - Counters have 1 Exemplar, native histograms and summaries have 4 Exemplars by default. For classic histogram use ExemplarSamplerConfig(ExemplarsProperties, double[]).
    • ExemplarSamplerConfig

      public ExemplarSamplerConfig(io.prometheus.metrics.config.ExemplarsProperties properties, double[] histogramClassicUpperBounds)
      Constructor for classic histogram metrics.
      Parameters:
      properties - See PrometheusProperties.getExemplarProperties().
      histogramClassicUpperBounds - the ExemplarSampler will provide one Exemplar per histogram bucket. Must be sorted, and must include the +Inf bucket.
  • Method Details

    • getHistogramClassicUpperBounds

      public double[] getHistogramClassicUpperBounds()
      May be null.
    • getMinRetentionPeriodMillis

      public long getMinRetentionPeriodMillis()
      See ExemplarsProperties.getMinRetentionPeriodSeconds()
    • getMaxRetentionPeriodMillis

      public long getMaxRetentionPeriodMillis()
      See ExemplarsProperties.getMaxRetentionPeriodSeconds()
    • getSampleIntervalMillis

      public long getSampleIntervalMillis()
      See ExemplarsProperties.getSampleIntervalMilliseconds()
    • getNumberOfExemplars

      public int getNumberOfExemplars()
      Defaults: Counters have one Exemplar, native histograms and summaries have 4 Exemplars, classic histograms have one Exemplar per bucket.