Package org.springframework.cloud.sleuth
Interface ScopedSpan
-
public interface ScopedSpanRepresents the "current span" untilend()()} is called.- Since:
- 3.0.0
- Author:
- OpenZipkin Brave Authors, Marcin Grzejszczak
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TraceContextcontext()voidend()Ends the span.ScopedSpanerror(Throwable throwable)Records an exception for this span.ScopedSpanevent(String value)Sets an event on this span.booleanisNoop()ScopedSpanname(String name)Sets a name on this span.ScopedSpantag(String key, String value)Sets a tag on this span.
-
-
-
Method Detail
-
isNoop
boolean isNoop()
- Returns:
truewhen no recording is done and nothing is reported to an external system. However, this span should still be injected into outgoing requests. Use this flag to avoid performing expensive computation.
-
context
TraceContext context()
- Returns:
TraceContextcorresponding to this span.
-
name
ScopedSpan name(String name)
Sets a name on this span.- Parameters:
name- name to set on the span- Returns:
- this span
-
tag
ScopedSpan tag(String key, String value)
Sets a tag on this span.- Parameters:
key- tag keyvalue- tag value- Returns:
- this span
-
event
ScopedSpan event(String value)
Sets an event on this span.- Parameters:
value- event name to set on the span- Returns:
- this span
-
error
ScopedSpan error(Throwable throwable)
Records an exception for this span.- Parameters:
throwable- to record- Returns:
- this span
-
end
void end()
Ends the span. The span gets stopped and recorded if not noop.
-
-