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 context. 010 */ 011 String getCurrentTraceId(); 012 013 /** 014 * @return the current span id, or {@code null} if this call is not happening within a span context. 015 */ 016 String getCurrentSpanId(); 017 018 /** 019 * @return the state of the current Span. If this value is false a component before in the chain take the decision to not record it. Subsequent calling service have 020 * to respect this value in order not to have partial TraceID with only some Span in it. This value is important to be sure to choose a recorded Trace in Examplar 021 * sampling process 022 */ 023 boolean isCurrentSpanSampled(); 024 025 void markCurrentSpanAsExemplar(); 026}