Package zipkin2
Class Span.Builder
- java.lang.Object
-
- zipkin2.Span.Builder
-
- Enclosing class:
- Span
public static final class Span.Builder extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Span.Builder
addAnnotation(long timestamp, java.lang.String value)
Span
build()
Span.Builder
clear()
Span.Builder
clearAnnotations()
Span.Builder
clearTags()
Span.Builder
clone()
Span.Builder
debug(boolean debug)
Span.Builder
debug(java.lang.Boolean debug)
Span.Builder
duration(long duration)
Span.Builder
duration(java.lang.Long duration)
Span.Builder
id(long id)
Encodes 64 bits from the input into a hex span ID.Span.Builder
id(java.lang.String id)
Span.Kind
kind()
Span.Builder
kind(Span.Kind kind)
Endpoint
localEndpoint()
Span.Builder
localEndpoint(Endpoint localEndpoint)
Span.Builder
merge(Span source)
Used to merge multiple incomplete spans representing the same operation on the same host.Span.Builder
name(java.lang.String name)
Span.Builder
parentId(long parentId)
Encodes 64 bits from the input into a hex parent ID.Span.Builder
parentId(java.lang.String parentId)
Span.Builder
putTag(java.lang.String key, java.lang.String value)
Span.Builder
remoteEndpoint(Endpoint remoteEndpoint)
Span.Builder
shared(boolean shared)
Span.Builder
shared(java.lang.Boolean shared)
Span.Builder
timestamp(long timestamp)
Span.Builder
timestamp(java.lang.Long timestamp)
Span.Builder
traceId(long high, long low)
Encodes 64 or 128 bits from the input into a hex trace ID.Span.Builder
traceId(java.lang.String traceId)
-
-
-
Method Detail
-
clear
public Span.Builder clear()
-
clone
public Span.Builder clone()
- Overrides:
clone
in classjava.lang.Object
-
merge
public Span.Builder merge(Span source)
Used to merge multiple incomplete spans representing the same operation on the same host. Do not use this to merge spans that occur on different hosts.
-
kind
@Nullable public Span.Kind kind()
-
localEndpoint
@Nullable public Endpoint localEndpoint()
-
traceId
public Span.Builder traceId(java.lang.String traceId)
- Throws:
java.lang.IllegalArgumentException
- if not lower-hex format- See Also:
Span.id()
-
traceId
public Span.Builder traceId(long high, long low)
Encodes 64 or 128 bits from the input into a hex trace ID.- Parameters:
high
- Upper 64bits of the trace ID. Zero means the trace ID is 64-bit.low
- Lower 64bits of the trace ID.- Throws:
java.lang.IllegalArgumentException
- if both values are zero
-
parentId
public Span.Builder parentId(long parentId)
Encodes 64 bits from the input into a hex parent ID. Unsets theSpan.parentId()
if the input is 0.- See Also:
Span.parentId()
-
parentId
public Span.Builder parentId(@Nullable java.lang.String parentId)
- Throws:
java.lang.IllegalArgumentException
- if not lower-hex format- See Also:
Span.parentId()
-
id
public Span.Builder id(long id)
Encodes 64 bits from the input into a hex span ID.- Throws:
java.lang.IllegalArgumentException
- if the input is zero- See Also:
Span.id()
-
id
public Span.Builder id(java.lang.String id)
- Throws:
java.lang.IllegalArgumentException
- if not lower-hex format- See Also:
Span.id()
-
kind
public Span.Builder kind(@Nullable Span.Kind kind)
- See Also:
Span.kind
-
name
public Span.Builder name(@Nullable java.lang.String name)
- See Also:
Span.name
-
timestamp
public Span.Builder timestamp(long timestamp)
- See Also:
Span.timestampAsLong()
-
timestamp
public Span.Builder timestamp(@Nullable java.lang.Long timestamp)
- See Also:
Span.timestamp()
-
duration
public Span.Builder duration(long duration)
- See Also:
Span.durationAsLong()
-
duration
public Span.Builder duration(@Nullable java.lang.Long duration)
- See Also:
Span.duration()
-
localEndpoint
public Span.Builder localEndpoint(@Nullable Endpoint localEndpoint)
- See Also:
Span.localEndpoint
-
remoteEndpoint
public Span.Builder remoteEndpoint(@Nullable Endpoint remoteEndpoint)
- See Also:
Span.remoteEndpoint
-
addAnnotation
public Span.Builder addAnnotation(long timestamp, java.lang.String value)
- See Also:
Span.annotations
-
clearAnnotations
public Span.Builder clearAnnotations()
- See Also:
Span.annotations
-
putTag
public Span.Builder putTag(java.lang.String key, java.lang.String value)
- See Also:
Span.tags
-
clearTags
public Span.Builder clearTags()
- See Also:
Span.tags
-
debug
public Span.Builder debug(boolean debug)
- See Also:
Span.debug()
-
debug
public Span.Builder debug(@Nullable java.lang.Boolean debug)
- See Also:
Span.debug()
-
shared
public Span.Builder shared(boolean shared)
- See Also:
Span.shared()
-
shared
public Span.Builder shared(@Nullable java.lang.Boolean shared)
- See Also:
Span.shared()
-
build
public Span build()
-
-