Interface Span
-
- All Known Implementing Classes:
DeferredSpan,NoopSpan,SpanImpl
public interface SpanLogical piece of a trace that represents a single operation. Each unit work is called a Span in a trace. Spans include metadata about the work, including the time spent in the step (latency), status, time events, attributes, links. You can use tracing to debug errors and latency issues in your applications.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description SpanaddLog(Supplier<String> logDescSupplier)Logs work to span.SpanaddTag(String tagName, Supplier<String> tagValSupplier)Adds tag to span withStringvalue.Spanend()Ends span.Set<Scope>includedScopes()default booleanisChainable(Scope scope)booleanisEnded()SpansetStatus(SpanStatus spanStatus)Explicitly set status for span.SpanTypetype()
-
-
-
Method Detail
-
addTag
Span addTag(String tagName, Supplier<String> tagValSupplier)
Adds tag to span withStringvalue.- Parameters:
tagName- Tag name.tagValSupplier- Tag value supplier. Supplier is used instead of strict tag value cause of it's lazy nature. So that it's possible not to generate String tag value in case of NoopSpan.
-
addLog
Span addLog(Supplier<String> logDescSupplier)
Logs work to span.- Parameters:
logDescSupplier- Log description supplier. Supplier is used instead of strict log description cause of it's lazy nature. So that it's possible not to generate String log description in case of NoopSpan.
-
setStatus
Span setStatus(SpanStatus spanStatus)
Explicitly set status for span.- Parameters:
spanStatus- Status.
-
end
Span end()
Ends span. This action sets default status if not set and mark the span as ready to be exported.
-
isEnded
boolean isEnded()
- Returns:
trueif span has already ended.
-
type
SpanType type()
- Returns:
- Type of given span.
-
isChainable
default boolean isChainable(Scope scope)
- Parameters:
scope- Chainable scope candidate.- Returns:
trueif given span is chainable with other spans with specified scope.
-
-