Interface Span
- All Known Implementing Classes:
AbstractSpan,NoopSpan
@ExperimentalApi
public interface Span
An interface that represents a tracing span.
Spans are created by the Tracer.startSpan method.
Span must be ended by calling SpanScope.close which internally calls Span's endSpan.
- Opensearch.experimental:
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(String key, Boolean value) Adds boolean type attribute in the spanvoidaddAttribute(String key, Double value) Adds double type attribute in the spanvoidaddAttribute(String key, Long value) Adds long type attribute in the spanvoidaddAttribute(String key, String value) Adds string type attribute in the spanvoidAdds an event in the spanvoidendSpan()Ends the spanReturns span's parent spanReturns spanId of the spanReturns the name of theSpanReturns traceId of the spanvoidRecords error in the span
-
Method Details
-
endSpan
void endSpan()Ends the span -
getParentSpan
Span getParentSpan()Returns span's parent span -
getSpanName
-
addAttribute
-
addAttribute
-
addAttribute
-
addAttribute
-
setError
Records error in the span- Parameters:
exception- exception to be recorded
-
addEvent
-
getTraceId
-
getSpanId
-