Interface ExemplarData

All Known Implementing Classes:
DoubleExemplarData, LongExemplarData

@Immutable public interface ExemplarData
A sample input measurement.

Exemplars also hold information about the environment when the measurement was recorded, for example the span and trace ID of the active span when the exemplar was recorded.

  • Method Details

    • getFilteredAttributes

      io.opentelemetry.api.common.Attributes getFilteredAttributes()
      The set of key/value pairs that were filtered out by the aggregator, but recorded alongside the original measurement. Only key/value pairs that were filtered out by the aggregator should be included
    • getEpochNanos

      long getEpochNanos()
      Returns the timestamp in nanos when measurement was collected.
    • getSpanContext

      io.opentelemetry.api.trace.SpanContext getSpanContext()
      Returns the SpanContext associated with this exemplar. If the exemplar was not recorded inside a sampled trace, the SpanContext will be invalid.
    • getSpanId

      @Nullable @Deprecated default String getSpanId()
      Deprecated.
      (Optional) Span ID of the exemplar trace.

      Span ID may be null if the measurement is not recorded inside a trace or the trace was not sampled.

    • getTraceId

      @Nullable @Deprecated default String getTraceId()
      Deprecated.
      (Optional) Trace ID of the exemplar trace.

      Trace ID may be null if the measurement is not recorded inside a trace or if the trace is not sampled.

    • getValueAsDouble

      @Deprecated double getValueAsDouble()
      Deprecated.
      Cast to LongExemplarData or DoubleExemplarData and call getValue().
      Coerces this exemplar to a double value.

      Note: This could create a loss of precision from long measurements.