Interface AssertingSpanBuilder
-
- All Superinterfaces:
Span.Builder
public interface AssertingSpanBuilder extends Span.Builder
ASpan.Builder
that can perform assertions on itself.- Since:
- 3.1.0
- Author:
- Marcin Grzejszczak
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default AssertingSpanBuilder
error(Throwable throwable)
Sets an error on the span.default AssertingSpanBuilder
event(String value)
Sets an event on the span.default AssertingSpanBuilder
event(EventValue value)
Sets an event on a span.Span.Builder
getDelegate()
DocumentedSpan
getDocumentedSpan()
default AssertingSpanBuilder
kind(Span.Kind spanKind)
Sets the kind on the span.default AssertingSpanBuilder
name(String name)
Sets the name of the span.static AssertingSpanBuilder
of(DocumentedSpan documentedSpan, Span.Builder builder)
default Span.Builder
remoteIpAndPort(String ip, int port)
Sets the remote URL for the span.default AssertingSpanBuilder
remoteServiceName(String remoteServiceName)
Sets the remote service name for the span.default AssertingSpanBuilder
setNoParent()
Sets no parent of the built span.default AssertingSpanBuilder
setParent(TraceContext context)
Sets the parent of the built span.default AssertingSpan
start()
Builds and starts the span.default AssertingSpanBuilder
tag(String key, String value)
Sets a tag on the span.default AssertingSpanBuilder
tag(TagKey key, String value)
Sets a tag on a span.
-
-
-
Method Detail
-
getDocumentedSpan
DocumentedSpan getDocumentedSpan()
- Returns:
- a
DocumentedSpan
with span configuration
-
getDelegate
Span.Builder getDelegate()
- Returns:
- wrapped
Span.Builder
-
tag
default AssertingSpanBuilder tag(String key, String value)
Description copied from interface:Span.Builder
Sets a tag on the span.- Specified by:
tag
in interfaceSpan.Builder
- Parameters:
key
- tag keyvalue
- tag value- Returns:
- this
-
tag
default AssertingSpanBuilder tag(TagKey key, String value)
Sets a tag on a span.- Parameters:
key
- tag keyvalue
- tag- Returns:
- this, for chaining
-
event
default AssertingSpanBuilder event(String value)
Description copied from interface:Span.Builder
Sets an event on the span.- Specified by:
event
in interfaceSpan.Builder
- Parameters:
value
- event value- Returns:
- this
-
event
default AssertingSpanBuilder event(EventValue value)
Sets an event on a span.- Parameters:
value
- event- Returns:
- this, for chaining
-
name
default AssertingSpanBuilder name(String name)
Description copied from interface:Span.Builder
Sets the name of the span.- Specified by:
name
in interfaceSpan.Builder
- Parameters:
name
- span name- Returns:
- this
-
error
default AssertingSpanBuilder error(Throwable throwable)
Description copied from interface:Span.Builder
Sets an error on the span.- Specified by:
error
in interfaceSpan.Builder
- Parameters:
throwable
- error to set- Returns:
- this
-
remoteServiceName
default AssertingSpanBuilder remoteServiceName(String remoteServiceName)
Description copied from interface:Span.Builder
Sets the remote service name for the span.- Specified by:
remoteServiceName
in interfaceSpan.Builder
- Parameters:
remoteServiceName
- remote service name- Returns:
- this
-
remoteIpAndPort
default Span.Builder remoteIpAndPort(String ip, int port)
Description copied from interface:Span.Builder
Sets the remote URL for the span.- Specified by:
remoteIpAndPort
in interfaceSpan.Builder
- Parameters:
ip
- remote service ipport
- remote service port- Returns:
- this
-
setParent
default AssertingSpanBuilder setParent(TraceContext context)
Description copied from interface:Span.Builder
Sets the parent of the built span.- Specified by:
setParent
in interfaceSpan.Builder
- Parameters:
context
- parent's context- Returns:
- this
-
setNoParent
default AssertingSpanBuilder setNoParent()
Description copied from interface:Span.Builder
Sets no parent of the built span.- Specified by:
setNoParent
in interfaceSpan.Builder
- Returns:
- this
-
kind
default AssertingSpanBuilder kind(Span.Kind spanKind)
Description copied from interface:Span.Builder
Sets the kind on the span.- Specified by:
kind
in interfaceSpan.Builder
- Parameters:
spanKind
- kind of the span- Returns:
- this
-
start
default AssertingSpan start()
Description copied from interface:Span.Builder
Builds and starts the span.- Specified by:
start
in interfaceSpan.Builder
- Returns:
- started span
-
of
static AssertingSpanBuilder of(DocumentedSpan documentedSpan, Span.Builder builder)
- Parameters:
documentedSpan
- span configurationbuilder
- builder to wrap in assertions- Returns:
- asserting span builder
-
-