java.lang.Object
io.prometheus.metrics.model.snapshots.Exemplar

public class Exemplar extends Object
Immutable representation of an Exemplar.
  • Field Details

  • Constructor Details

    • Exemplar

      public Exemplar(double value, Labels labels, long timestampMillis)
      To create a new Exemplar, you can either call the constructor directly or use the Builder with builder().
      Parameters:
      value - the observed value. This is required.
      labels - in most cases the labels will contain the TRACE_ID and SPAN_ID. Must not be null. Use Labels.EMPTY if no labels are present.
      timestampMillis - timestamp when the value was observed. Optional. Use 0L if not available.
  • Method Details

    • getValue

      public double getValue()
    • getLabels

      public Labels getLabels()
      In most cases labels will contain TRACE_ID and SPAN_ID, but this is not required. May be Labels.EMPTY, but may not be null.
    • hasTimestamp

      public boolean hasTimestamp()
    • getTimestampMillis

      public long getTimestampMillis()
      Will return garbage if hasTimestamp() is false.
    • builder

      public static Exemplar.Builder builder()