Class HistogramSnapshot.HistogramDataPointSnapshot

Enclosing class:
HistogramSnapshot

public static final class HistogramSnapshot.HistogramDataPointSnapshot extends DistributionDataPointSnapshot
  • Constructor Details

    • HistogramDataPointSnapshot

      public HistogramDataPointSnapshot(ClassicHistogramBuckets classicBuckets, double sum, Labels labels, Exemplars exemplars, long createdTimestampMillis)
      Constructor for classic histograms (as opposed to native histograms).

      To create a new HistogramSnapshot.HistogramDataPointSnapshot, you can either call the constructor directly or use the Builder with HistogramSnapshot.builder().

      Parameters:
      classicBuckets - required. Must not be empty. Must at least contain the +Inf bucket.
      sum - sum of all observed values. Optional, pass Double.NaN if not available.
      labels - must not be null. Use Labels.EMPTY if there are no labels.
      exemplars - must not be null. Use Exemplars.EMPTY if there are no Exemplars.
      createdTimestampMillis - timestamp (as in System.currentTimeMillis()) when the time series (this specific set of labels) was created (or reset to zero). It's optional. Use 0L if there is no created timestamp.
    • HistogramDataPointSnapshot

      public HistogramDataPointSnapshot(int nativeSchema, long nativeZeroCount, double nativeZeroThreshold, NativeHistogramBuckets nativeBucketsForPositiveValues, NativeHistogramBuckets nativeBucketsForNegativeValues, double sum, Labels labels, Exemplars exemplars, long createdTimestampMillis)
      Constructor for native histograms (as opposed to classic histograms).

      To create a new HistogramSnapshot.HistogramDataPointSnapshot, you can either call the constructor directly or use the Builder with HistogramSnapshot.builder().

      Parameters:
      nativeSchema - number in [-4, 8]. See Prometheus client_model metrics.proto.
      nativeZeroCount - number of observed zero values (zero is special because there is no histogram bucket for zero values).
      nativeZeroThreshold - observations in [-zeroThreshold, +zeroThreshold] are treated as zero. This is to avoid creating a large number of buckets if observations fluctuate around zero.
      nativeBucketsForPositiveValues - must not be null. Use NativeHistogramBuckets.EMPTY if empty.
      nativeBucketsForNegativeValues - must not be null. Use NativeHistogramBuckets.EMPTY if empty.
      sum - sum of all observed values. Optional, use Double.NaN if not available.
      labels - must not be null. Use Labels.EMPTY if there are no labels.
      exemplars - must not be null. Use Exemplars.EMPTY if there are no Exemplars.
      createdTimestampMillis - timestamp (as in System.currentTimeMillis()) when the time series (this specific set of labels) was created (or reset to zero). It's optional. Use 0L if there is no created timestamp.
    • HistogramDataPointSnapshot

      public HistogramDataPointSnapshot(ClassicHistogramBuckets classicBuckets, int nativeSchema, long nativeZeroCount, double nativeZeroThreshold, NativeHistogramBuckets nativeBucketsForPositiveValues, NativeHistogramBuckets nativeBucketsForNegativeValues, double sum, Labels labels, Exemplars exemplars, long createdTimestampMillis)
      Constructor for a histogram with both, classic and native data.

      To create a new HistogramSnapshot.HistogramDataPointSnapshot, you can either call the constructor directly or use the Builder with HistogramSnapshot.builder().

      Parameters:
      classicBuckets - required. Must not be empty. Must at least contain the +Inf bucket.
      nativeSchema - number in [-4, 8]. See Prometheus client_model metrics.proto.
      nativeZeroCount - number of observed zero values (zero is special because there is no histogram bucket for zero values).
      nativeZeroThreshold - observations in [-zeroThreshold, +zeroThreshold] are treated as zero. This is to avoid creating a large number of buckets if observations fluctuate around zero.
      nativeBucketsForPositiveValues - must not be null. Use NativeHistogramBuckets.EMPTY if empty.
      nativeBucketsForNegativeValues - must not be null. Use NativeHistogramBuckets.EMPTY if empty.
      sum - sum of all observed values. Optional, use Double.NaN if not available.
      labels - must not be null. Use Labels.EMPTY if there are no labels.
      exemplars - must not be null. Use Exemplars.EMPTY if there are no Exemplars.
      createdTimestampMillis - timestamp (as in System.currentTimeMillis()) when the time series (this specific set of labels) was created (or reset to zero). It's optional. Use 0L if there is no created timestamp.
    • HistogramDataPointSnapshot

      public HistogramDataPointSnapshot(ClassicHistogramBuckets classicBuckets, int nativeSchema, long nativeZeroCount, double nativeZeroThreshold, NativeHistogramBuckets nativeBucketsForPositiveValues, NativeHistogramBuckets nativeBucketsForNegativeValues, double sum, Labels labels, Exemplars exemplars, long createdTimestampMillis, long scrapeTimestampMillis)
      Constructor with an additional scrape timestamp. This is only useful in rare cases as the scrape timestamp is usually set by the Prometheus server during scraping. Exceptions include mirroring metrics with given timestamps from other metric sources.
  • Method Details