Package org.springframework.cloud.sleuth
Interface ScopedSpan
-
public interface ScopedSpan
Represents 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 TraceContext
context()
void
end()
Ends the span.ScopedSpan
error(Throwable throwable)
Records an exception for this span.ScopedSpan
event(String value)
Sets an event on this span.boolean
isNoop()
ScopedSpan
name(String name)
Sets a name on this span.ScopedSpan
tag(String key, String value)
Sets a tag on this span.
-
-
-
Method Detail
-
isNoop
boolean isNoop()
- Returns:
true
when 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:
TraceContext
corresponding 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.
-
-