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.BuilderaddAnnotation(long timestamp, java.lang.String value)Spanbuild()Span.Builderclear()Span.BuilderclearAnnotations()Span.BuilderclearTags()Span.Builderclone()Span.Builderdebug(boolean debug)Span.Builderdebug(java.lang.Boolean debug)Span.Builderduration(long duration)Span.Builderduration(java.lang.Long duration)Span.Builderid(long id)Encodes 64 bits from the input into a hex span ID.Span.Builderid(java.lang.String id)Span.Kindkind()Span.Builderkind(Span.Kind kind)EndpointlocalEndpoint()Span.BuilderlocalEndpoint(Endpoint localEndpoint)Span.Buildermerge(Span source)Used to merge multiple incomplete spans representing the same operation on the same host.Span.Buildername(java.lang.String name)Span.BuilderparentId(long parentId)Encodes 64 bits from the input into a hex parent ID.Span.BuilderparentId(java.lang.String parentId)Span.BuilderputTag(java.lang.String key, java.lang.String value)Span.BuilderremoteEndpoint(Endpoint remoteEndpoint)Span.Buildershared(boolean shared)Span.Buildershared(java.lang.Boolean shared)Span.Buildertimestamp(long timestamp)Span.Buildertimestamp(java.lang.Long timestamp)Span.BuildertraceId(long high, long low)Encodes 64 or 128 bits from the input into a hex trace ID.Span.BuildertraceId(java.lang.String traceId)
-
-
-
Method Detail
-
clear
public Span.Builder clear()
-
clone
public Span.Builder clone()
- Overrides:
clonein 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()
-
-