Package zipkin2.proto3
Class Span.Builder
- java.lang.Object
-
- com.squareup.wire.Message.Builder<Span,Span.Builder>
-
- zipkin2.proto3.Span.Builder
-
- Enclosing class:
- Span
public static final class Span.Builder extends com.squareup.wire.Message.Builder<Span,Span.Builder>
-
-
Field Summary
Fields Modifier and Type Field Description List<Annotation>
annotations
Boolean
debug
Long
duration
okio.ByteString
id
Span.Kind
kind
Endpoint
local_endpoint
String
name
okio.ByteString
parent_id
Endpoint
remote_endpoint
Boolean
shared
Map<String,String>
tags
Long
timestamp
okio.ByteString
trace_id
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Span.Builder
annotations(List<Annotation> annotations)
Associates events that explain latency with the time they happened.Span
build()
Span.Builder
debug(Boolean debug)
True is a request to store this span even if it overrides sampling policy.Span.Builder
duration(Long duration)
Duration in microseconds of the critical path, if known.Span.Builder
id(okio.ByteString id)
Unique identifier for this operation within the trace.Span.Builder
kind(Span.Kind kind)
When present, used to interpret remote_endpointSpan.Builder
local_endpoint(Endpoint local_endpoint)
The host that recorded this span, primarily for query by service name.Span.Builder
name(String name)
The logical operation this span represents in lowercase (e.g.Span.Builder
parent_id(okio.ByteString parent_id)
The parent span ID or absent if this the root span in a trace.Span.Builder
remote_endpoint(Endpoint remote_endpoint)
When an RPC (or messaging) span, indicates the other side of the connection.Span.Builder
shared(Boolean shared)
True if we are contributing to a span started by another tracer (ex on a different host).Span.Builder
tags(Map<String,String> tags)
Tags give your span context for search, viewing and analysis.Span.Builder
timestamp(Long timestamp)
Epoch microseconds of the start of this span, possibly absent if incomplete.Span.Builder
trace_id(okio.ByteString trace_id)
Randomly generated, unique identifier for a trace, set on all spans within it.-
Methods inherited from class com.squareup.wire.Message.Builder
addUnknownField, addUnknownFields, buildUnknownFields, clearUnknownFields, getUnknownFieldsBuffer$wire_runtime, getUnknownFieldsByteString$wire_runtime, getUnknownFieldsWriter$wire_runtime, setUnknownFieldsBuffer$wire_runtime, setUnknownFieldsByteString$wire_runtime, setUnknownFieldsWriter$wire_runtime
-
-
-
-
Field Detail
-
trace_id
public okio.ByteString trace_id
-
parent_id
public okio.ByteString parent_id
-
id
public okio.ByteString id
-
kind
public Span.Kind kind
-
name
public String name
-
timestamp
public Long timestamp
-
duration
public Long duration
-
local_endpoint
public Endpoint local_endpoint
-
remote_endpoint
public Endpoint remote_endpoint
-
annotations
public List<Annotation> annotations
-
debug
public Boolean debug
-
shared
public Boolean shared
-
-
Method Detail
-
trace_id
public Span.Builder trace_id(okio.ByteString trace_id)
Randomly generated, unique identifier for a trace, set on all spans within it. This field is required and encoded as 8 or 16 bytes, in big endian byte order.
-
parent_id
public Span.Builder parent_id(okio.ByteString parent_id)
The parent span ID or absent if this the root span in a trace.
-
id
public Span.Builder id(okio.ByteString id)
Unique identifier for this operation within the trace. This field is required and encoded as 8 opaque bytes.
-
kind
public Span.Builder kind(Span.Kind kind)
When present, used to interpret remote_endpoint
-
name
public Span.Builder name(String name)
The logical operation this span represents in lowercase (e.g. rpc method). Leave absent if unknown. As these are lookup labels, take care to ensure names are low cardinality. For example, do not embed variables into the name.
-
timestamp
public Span.Builder timestamp(Long timestamp)
Epoch microseconds of the start of this span, possibly absent if incomplete. For example, 1502787600000000 corresponds to 2017-08-15 09:00 UTC This value should be set directly by instrumentation, using the most precise value possible. For example, gettimeofday or multiplying epoch millis by 1000. There are three known edge-cases where this could be reported absent. - A span was allocated but never started (ex not yet received a timestamp) - The span's start event was lost - Data about a completed span (ex tags) were sent after the fact
-
duration
public Span.Builder duration(Long duration)
Duration in microseconds of the critical path, if known. Durations of less than one are rounded up. Duration of children can be longer than their parents due to asynchronous operations. For example 150 milliseconds is 150000 microseconds.
-
local_endpoint
public Span.Builder local_endpoint(Endpoint local_endpoint)
The host that recorded this span, primarily for query by service name. Instrumentation should always record this. Usually, absent implies late data. The IP address corresponding to this is usually the site local or advertised service address. When present, the port indicates the listen port.
-
remote_endpoint
public Span.Builder remote_endpoint(Endpoint remote_endpoint)
When an RPC (or messaging) span, indicates the other side of the connection. By recording the remote endpoint, your trace will contain network context even if the peer is not tracing. For example, you can record the IP from the "X-Forwarded-For" header or the service name and socket of a remote peer.
-
annotations
public Span.Builder annotations(List<Annotation> annotations)
Associates events that explain latency with the time they happened.
-
tags
public Span.Builder tags(Map<String,String> tags)
Tags give your span context for search, viewing and analysis. For example, a key "your_app.version" would let you lookup traces by version. A tag "sql.query" isn't searchable, but it can help in debugging when viewing a trace.
-
debug
public Span.Builder debug(Boolean debug)
True is a request to store this span even if it overrides sampling policy. This is true when the "X-B3-Flags" header has a value of 1.
-
shared
public Span.Builder shared(Boolean shared)
True if we are contributing to a span started by another tracer (ex on a different host).
-
build
public Span build()
- Specified by:
build
in classcom.squareup.wire.Message.Builder<Span,Span.Builder>
-
-