Class CounterSnapshot.CounterDataPointSnapshot

java.lang.Object
io.prometheus.metrics.model.snapshots.DataPointSnapshot
io.prometheus.metrics.model.snapshots.CounterSnapshot.CounterDataPointSnapshot
Enclosing class:
CounterSnapshot

public static class CounterSnapshot.CounterDataPointSnapshot extends DataPointSnapshot
  • Constructor Details

    • CounterDataPointSnapshot

      public CounterDataPointSnapshot(double value, Labels labels, Exemplar exemplar, long createdTimestampMillis)
      To create a new CounterSnapshot.CounterDataPointSnapshot, you can either call the constructor directly or use the Builder with builder().
      Parameters:
      value - the counter value. Must not be negative.
      labels - must not be null. Use Labels.EMPTY if there are no labels.
      exemplar - may be null.
      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.
    • CounterDataPointSnapshot

      public CounterDataPointSnapshot(double value, Labels labels, Exemplar exemplar, 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