All Superinterfaces:
Span , SpanCustomizer
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.
Since:
3.1.0
Author:
Marcin Grzejszczak
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods
default void
default void
Records an exception for this span.
Sets an event on this span.
default boolean
default boolean
Sets a name on this span.
Sets the remote url on the span.
Sets the remote service name for the span.
Returns the underlying delegate.
Method Details
getDelegate
Returns:
wrapped Span
isStarted
default boolean isStarted ()
Returns:
true when this span was started
tag
Description copied from interface: Span
Sets a tag on this span.
Specified by:
tag in interface Span
Specified by:
tag in interface SpanCustomizer
Parameters:
key - tag key
value - tag value
Returns:
this span
tag
Parameters:
key - tag key
value - tag value
Returns:
this for chaining
event
Description copied from interface: Span
Sets an event on this span.
Specified by:
event in interface Span
Specified by:
event in interface SpanCustomizer
Parameters:
value - event name to set on the span
Returns:
this span
event
Parameters:
value - event value
Returns:
this for chaining
name
Description copied from interface: Span
Sets a name on this span.
Specified by:
name in interface Span
Specified by:
name in interface SpanCustomizer
Parameters:
name - name to set on the span
Returns:
this span
isNoop
default boolean isNoop ()
Specified by:
isNoop in interface Span
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
Specified by:
context in interface Span
Returns:
TraceContext corresponding to this span.
start
Description copied from interface: Span
Starts this span.
Specified by:
start in interface Span
Returns:
this span
error
Description copied from interface: Span
Records an exception for this span.
Specified by:
error in interface Span
Parameters:
throwable - to record
Returns:
this span
end
default void end ()
Description copied from interface: Span
Ends the span. The span gets stopped and recorded if not noop.
Specified by:
end in interface Span
abandon
default void abandon ()
Description copied from interface: Span
Ends the span. The span gets stopped but does not get recorded.
Specified by:
abandon in interface Span
remoteServiceName
Description copied from interface: Span
Sets the remote service name for the span.
Specified by:
remoteServiceName in interface Span
Parameters:
remoteServiceName - remote service name
Returns:
this span
remoteIpAndPort
Description copied from interface: Span
Sets the remote url on the span.
Specified by:
remoteIpAndPort in interface Span
Parameters:
ip - remote ip
port - remote port
Returns:
this span
of
Parameters:
documentedSpan - span configuration
span - span to wrap in assertions
Returns:
asserting span
continueSpan
Parameters:
documentedSpan - span configuration
span - span to wrap in assertions
Returns:
asserting span
unwrap
static <T extends Span > T unwrap (Span span)
Returns the underlying delegate. Used when casting is necessary.
Type Parameters:
T - type extending a span
Parameters:
span - span to check for wrapping
Returns:
unwrapped object