long timestamp
This value should be set directly by instrumentation, using the most precise value possible.
For example, gettimeofday or multiplying System.currentTimeMillis() by 1000.
String value
Endpoint endpoint
Annotation.value, primarily for query by service name.final Object writeReplace() throws ObjectStreamException
ObjectStreamExceptionString parent
String child
long callCount
DependencyLink.parent to DependencyLink.childlong errorCount
String serviceName
This is the primary parameter for trace lookup, so should be intuitive as possible, for example, matching names in service discovery.
Conventionally, when the service name isn't known, service_name = "unknown". However, it is also permissible to set service_name = "" (empty string). The difference in the latter usage is that the span will not be queryable by service name unless more information is added to the span with non-empty service name, e.g. an additional annotation from the server.
Particularly clients may not have a reliable service name at ingest. One approach is to set service_name to "" at ingest, and later assign a better label based on binary annotations, such as user agent.
int ipv4
Ex for the IP 1.2.3.4, it would be (1 << 24) | (2 << 16) | (3 << 8) | 4
Inet4Address.getAddress()byte[] ipv6
Inet6Address.getAddress()Short port
Note: this is to be treated as an unsigned integer, so watch for negatives.
Ex.
Integer unsignedPort = endpoint.port == null ? null : endpoint.port & 0xffff;
InetSocketAddress.getPort()final Object writeReplace() throws ObjectStreamException
ObjectStreamExceptionlong traceIdHigh
traceIdHigh corresponds to the high bits in big-endian format and Span.traceId
corresponds to the low bits.
Ex. to convert the two fields to a 128bit opaque id array, you'd use code like below.
ByteBuffer traceId128 = ByteBuffer.allocate(16);
traceId128.putLong(span.traceIdHigh);
traceId128.putLong(span.traceId);
traceBytes = traceId128.array();
StorageComponent.Builder#strictTraceId(boolean)long traceId
String name
Conventionally, when the span name isn't known, name = "unknown".
long id
A span is uniquely identified in storage by (Span.traceId, #id).
Long parentId
Span.id or null if this the root span in a trace.Long timestamp
This value should be set directly by instrumentation, using the most precise value
possible. For example, gettimeofday or multiplying System.currentTimeMillis() by
1000.
For compatibility 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..
Long duration
This value should be set directly, as opposed to implicitly via annotation timestamps. Doing so encourages precision decoupled from problems of clocks, such as skew or NTP updates causing time to move backwards.
For compatibility with instrumentation that precede this field, collectors or span stores
can derive this by subtracting 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.
List<E> annotations
Unlike log statements, annotations are often codes: for example Constants.SERVER_RECV. Annotations are sorted ascending by timestamp.
List<E> binaryAnnotations
example, a binary annotation key could be "http.path".
Boolean debug
Copyright © 2015–2018 OpenZipkin. All rights reserved.