Cloneablepublic final class MutableSpan extends Object implements Cloneable
TraceContext. It is mutable, for late adjustments.
While in-flight, the data is synchronized where necessary. When exposed to users, it can be mutated without synchronization.
| Modifier and Type | Class | Description |
|---|---|---|
static interface |
MutableSpan.AnnotationConsumer<T> |
|
static interface |
MutableSpan.AnnotationUpdater |
|
static interface |
MutableSpan.TagConsumer<T> |
|
static interface |
MutableSpan.TagUpdater |
| Constructor | Description |
|---|---|
MutableSpan() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
annotate(long timestamp,
String value) |
|
Throwable |
error() |
|
void |
error(Throwable error) |
|
long |
finishTimestamp() |
Returns the
span finish timestamp or zero |
void |
finishTimestamp(long finishTimestamp) |
|
<T> void |
forEachAnnotation(MutableSpan.AnnotationConsumer<T> annotationConsumer,
T target) |
Allows you to copy all data into a different target, such as a different span model or logs.
|
void |
forEachAnnotation(MutableSpan.AnnotationUpdater annotationUpdater) |
Allows you to update values for redaction purposes
|
<T> void |
forEachTag(MutableSpan.TagConsumer<T> tagConsumer,
T target) |
|
void |
forEachTag(MutableSpan.TagUpdater tagUpdater) |
Allows you to update values for redaction purposes
|
Span.Kind |
kind() |
Returns the
span kind or null |
void |
kind(Span.Kind kind) |
|
String |
localIp() |
When null
default will be used for zipkin. |
boolean |
localIp(String localIp) |
|
int |
localPort() |
When zero
default will be used for zipkin. |
void |
localPort(int localPort) |
|
String |
localServiceName() |
When null
default will be used for
zipkin. |
void |
localServiceName(String localServiceName) |
|
String |
name() |
Returns the
span name or null |
void |
name(String name) |
|
String |
remoteIp() |
The text representation of the primary IPv4 or IPv6 address associated with the remote side of
this connection.
|
boolean |
remoteIpAndPort(String remoteIp,
int remotePort) |
|
int |
remotePort() |
Port of the remote IP's socket or 0, if not known.
|
String |
remoteServiceName() |
|
void |
remoteServiceName(String remoteServiceName) |
|
void |
setShared() |
Indicates we are contributing to a span started by another tracer (ex on a different host).
|
boolean |
shared() |
Returns true if the span ID is
shared with a remote client. |
long |
startTimestamp() |
Returns the
span start timestamp or zero |
void |
startTimestamp(long startTimestamp) |
|
String |
tag(String key) |
Returns the last value associated with the key or null
|
void |
tag(String key,
String value) |
public void name(String name)
Span.name(String)public long startTimestamp()
span start timestamp or zeropublic void startTimestamp(long startTimestamp)
Span.start(long)public long finishTimestamp()
span finish timestamp or zeropublic void finishTimestamp(long finishTimestamp)
Span.finish(long)public void kind(Span.Kind kind)
Span.kind(brave.Span.Kind)@Nullable public String localServiceName()
default will be used for
zipkin.public void localServiceName(String localServiceName)
Tracing.Builder.localServiceName(String)public int localPort()
default will be used for zipkin.public void localPort(int localPort)
localPort()@Nullable public String remoteServiceName()
Span.remoteServiceName(String)public void remoteServiceName(String remoteServiceName)
Span.remoteServiceName(String)@Nullable public String remoteIp()
Span.remoteIpAndPort(String, int)public int remotePort()
public boolean remoteIpAndPort(@Nullable String remoteIp, int remotePort)
Span.remoteIpAndPort(String, int)public void annotate(long timestamp,
String value)
Span.annotate(String)public Throwable error()
Span.error(Throwable)public void error(Throwable error)
Span.error(Throwable)public void tag(String key, String value)
Span.tag(String, String)public <T> void forEachTag(MutableSpan.TagConsumer<T> tagConsumer, T target)
public void forEachTag(MutableSpan.TagUpdater tagUpdater)
public <T> void forEachAnnotation(MutableSpan.AnnotationConsumer<T> annotationConsumer, T target)
public void forEachAnnotation(MutableSpan.AnnotationUpdater annotationUpdater)
public boolean shared()
shared with a remote client.public void setShared()
Tracer.joinSpan(TraceContext),
Span.shared()Copyright © 2018 OpenZipkin. All rights reserved.