001package io.prometheus.metrics.tracer.common;
002
003public interface SpanContext {
004
005  String EXEMPLAR_ATTRIBUTE_NAME = "exemplar";
006  String EXEMPLAR_ATTRIBUTE_VALUE = "true";
007
008  /**
009   * @return the current trace id, or {@code null} if this call is not happening within a span
010   *     context.
011   */
012  String getCurrentTraceId();
013
014  /**
015   * @return the current span id, or {@code null} if this call is not happening within a span
016   *     context.
017   */
018  String getCurrentSpanId();
019
020  /**
021   * @return the state of the current Span. If this value is false a component before in the chain
022   *     take the decision to not record it. Subsequent calling service have to respect this value
023   *     in order not to have partial TraceID with only some Span in it. This value is important to
024   *     be sure to choose a recorded Trace in Examplar sampling process
025   */
026  boolean isCurrentSpanSampled();
027
028  void markCurrentSpanAsExemplar();
029}