Class ExemplarSamplerConfig

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

public class ExemplarSamplerConfig extends Object
  • Field Details

  • Constructor Details

    • ExemplarSamplerConfig

      public ExemplarSamplerConfig(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(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.
    • ExemplarSamplerConfig

      private ExemplarSamplerConfig(ExemplarsProperties properties, int numberOfExemplars, double[] histogramClassicUpperBounds)
    • ExemplarSamplerConfig

      ExemplarSamplerConfig(long minRetentionPeriodMillis, long maxRetentionPeriodMillis, long sampleIntervalMillis, int numberOfExemplars, double[] histogramClassicUpperBounds)
  • Method Details

    • validate

      private void validate()
    • getOrDefault

      private static <T> T getOrDefault(T result, T defaultValue)
    • getHistogramClassicUpperBounds

      public double[] getHistogramClassicUpperBounds()
    • getMinRetentionPeriodMillis

      public long getMinRetentionPeriodMillis()
    • getMaxRetentionPeriodMillis

      public long getMaxRetentionPeriodMillis()
    • getSampleIntervalMillis

      public long getSampleIntervalMillis()
    • getNumberOfExemplars

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