Package io.opentelemetry.sdk.trace
Interface ReadableSpan
-
- All Known Subinterfaces:
ReadWriteSpan
public interface ReadableSpanThe extend Span interface used by the SDK.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description io.opentelemetry.sdk.common.InstrumentationLibraryInfogetInstrumentationLibraryInfo()Returns the instrumentation library specified when creating the tracer which produced this span.io.opentelemetry.api.trace.Span.KindgetKind()Returns the kind of the span.longgetLatencyNanos()Returns the latency of theSpanin nanos.StringgetName()Returns the name of theSpan.io.opentelemetry.api.trace.SpanContextgetSpanContext()Returns theSpanContextof theSpan.booleanhasEnded()Returns whether this Span has already been ended.SpanDatatoSpanData()This converts this instance into an immutable SpanData instance, for use in export.
-
-
-
Method Detail
-
getSpanContext
io.opentelemetry.api.trace.SpanContext getSpanContext()
Returns theSpanContextof theSpan.Equivalent with
Span.getSpanContext().- Returns:
- the
SpanContextof theSpan.
-
getName
String getName()
Returns the name of theSpan.The name can be changed during the lifetime of the Span by using the
Span.updateName(String)so this value cannot be cached.- Returns:
- the name of the
Span.
-
toSpanData
SpanData toSpanData()
This converts this instance into an immutable SpanData instance, for use in export.- Returns:
- an immutable
SpanDatainstance.
-
getInstrumentationLibraryInfo
io.opentelemetry.sdk.common.InstrumentationLibraryInfo getInstrumentationLibraryInfo()
Returns the instrumentation library specified when creating the tracer which produced this span.- Returns:
- an instance of
InstrumentationLibraryInfodescribing the instrumentation library
-
hasEnded
boolean hasEnded()
Returns whether this Span has already been ended.- Returns:
trueif the span has already been ended,falseif not.
-
getLatencyNanos
long getLatencyNanos()
Returns the latency of theSpanin nanos. If still active then returns now() - start time.- Returns:
- the latency of the
Spanin nanos.
-
getKind
io.opentelemetry.api.trace.Span.Kind getKind()
Returns the kind of the span.- Returns:
- the kind of the span.
-
-