public final class Span extends Object implements Comparable<Span>
parentId is null; it usually has the longest duration in the
trace.
Span identifiers are packed into longs, but should be treated opaquely. String encoding is
fixed-width lower-hex, to avoid signed interpretation.| Modifier and Type | Class and Description |
|---|---|
static class |
Span.Builder |
| Modifier and Type | Field and Description |
|---|---|
List<Annotation> |
annotations
Associates events that explain latency with a timestamp.
|
List<BinaryAnnotation> |
binaryAnnotations
Tags a span with context, usually to support query or aggregation.
|
Boolean |
debug
True is a request to store this span even if it overrides sampling policy.
|
Long |
duration
Measurement in microseconds of the critical path, if known.
|
long |
id
Unique 8-byte identifier of this span within a trace.
|
String |
name
Span name in lowercase, rpc method for example.
|
Long |
parentId
The parent's
id or null if this the root span in a trace. |
Long |
timestamp
Epoch microseconds of the start of this span, possibly absent if this an incomplete span.
|
long |
traceId
Unique 8-byte identifier for a trace, set on all spans within it.
|
public final long traceId
public final String name
public final long id
#id).@Nullable public final Long parentId
id or null if this the root span in a trace.@Nullable public final Long timestamp
gettimeofday or syncing System.nanoTime() against a tick
of System.currentTimeMillis().
For compatibilty with instrumentation that precede this field, collectors or span stores
can derive this via Annotation.timestamp. For example, Constants.SERVER_RECV.timestamp
or Constants.CLIENT_SEND.timestamp.
Timestamp is nullable for input only. Spans without a timestamp cannot be presented in a
timeline: Span stores should not output spans missing a timestamp.
There are two known edge-cases where this could be absent: both cases exist when a
collector receives a span in parts and a binary annotation precedes a timestamp. This is
possible when..
@Nullable public final Long duration
Annotation.timestamp. For example, Constants.SERVER_SEND.timestamp - Constants.SERVER_RECV.timestamp.
If this field is persisted as unset, zipkin will continue to work, except duration query
support will be implementation-specific. Similarly, setting this field non-atomically is
implementation-specific.
This field is i64 vs i32 to support spans longer than 35 minutes.public final List<Annotation> annotations
Constants.SERVER_RECV. Annotations are sorted ascending by timestamp.public final List<BinaryAnnotation> binaryAnnotations
@Nullable public final Boolean debug
public int compareTo(Span that)
compareTo in interface Comparable<Span>Copyright © 2015–2016 OpenZipkin. All rights reserved.