public interface AssertingSpan extends Span
Span that performs additional assertions such as allowed name, tag, event
verification and upon reporting, whether the span had been started in the first place.
You need to turn on assertions via system properties or environment variables to start
breaking your tests or production code. Check DocumentedSpanAssertions for more
information.Span.Builder, Span.Kind| Modifier and Type | Method and Description |
|---|---|
default void |
abandon()
Ends the span.
|
default TraceContext |
context() |
default void |
end()
Ends the span.
|
default AssertingSpan |
error(Throwable throwable)
Records an exception for this span.
|
default AssertingSpan |
event(EventValue value)
Annotates with an event via
EventValue. |
default AssertingSpan |
event(String value)
Sets an event on this span.
|
Span |
getDelegate() |
DocumentedSpan |
getDocumentedSpan() |
default boolean |
isNoop() |
default boolean |
isStarted() |
default AssertingSpan |
name(String name)
Sets a name on this span.
|
static AssertingSpan |
of(DocumentedSpan documentedSpan,
Span span) |
default Span |
remoteIpAndPort(String ip,
int port)
Sets the remote url on the span.
|
default AssertingSpan |
remoteServiceName(String remoteServiceName)
Sets the remote service name for the span.
|
default AssertingSpan |
start()
Starts this span.
|
default AssertingSpan |
tag(String key,
String value)
Sets a tag on this span.
|
default AssertingSpan |
tag(TagKey key,
String value)
Tags a span via
TagKey. |
static <T extends Span> |
unwrap(Span span)
Returns the underlying delegate.
|
DocumentedSpan getDocumentedSpan()
DocumentedSpan with span configurationdefault boolean isStarted()
true when this span was starteddefault AssertingSpan tag(String key, String value)
Spantag in interface Spantag in interface SpanCustomizerkey - tag keyvalue - tag valuedefault AssertingSpan tag(TagKey key, String value)
TagKey.key - tag keyvalue - tag valuedefault AssertingSpan event(String value)
Spanevent in interface Spanevent in interface SpanCustomizervalue - event name to set on the spandefault AssertingSpan event(EventValue value)
EventValue.value - event valuedefault AssertingSpan name(String name)
Spanname in interface Spanname in interface SpanCustomizername - name to set on the spandefault boolean isNoop()
default TraceContext context()
context in interface SpanTraceContext corresponding to this span.default AssertingSpan start()
Spandefault AssertingSpan error(Throwable throwable)
Spandefault void end()
Spandefault void abandon()
Spandefault AssertingSpan remoteServiceName(String remoteServiceName)
SpanremoteServiceName in interface SpanremoteServiceName - remote service namedefault Span remoteIpAndPort(String ip, int port)
SpanremoteIpAndPort in interface Spanip - remote ipport - remote portstatic AssertingSpan of(DocumentedSpan documentedSpan, Span span)
documentedSpan - span configurationspan - span to wrap in assertionsCopyright © 2021 Pivotal Software, Inc.. All rights reserved.