public interface Span extends AutoCloseable
Spans are created by the Tracer.buildSpan(java.lang.String)
interface.
Modifier and Type | Method and Description |
---|---|
void |
close() |
SpanContext |
context()
Retrieve the associated SpanContext.
|
void |
finish()
Sets the end timestamp to now and records the span.
|
void |
finish(long finishMicros)
Sets an explicit end timestamp and records the span.
|
String |
getBaggageItem(String key) |
Span |
log(long timestampMicroseconds,
String eventName,
Object payload)
Add a new log event to the Span, accepting an event name string and an optional structured payload argument.
|
Span |
log(String eventName,
Object payload)
Add a new log event to the Span, accepting an event name string and an optional structured payload argument.
|
Span |
setBaggageItem(String key,
String value)
Sets a baggage item in the Span (and its SpanContext) as a key/value pair.
|
Span |
setOperationName(String operationName)
Sets the string name for the logical operation this span represents.
|
Span |
setTag(String key,
boolean value)
Same as
setTag(String, String) , but for boolean values. |
Span |
setTag(String key,
Number value)
Same as
setTag(String, String) , but for numeric values. |
Span |
setTag(String key,
String value)
Set a key:value tag on the Span.
|
SpanContext context()
void finish()
With the exception of calls to Span.context(), this should be the last call made to the span instance, and to do otherwise leads to undefined behavior.
context()
void finish(long finishMicros)
With the exception of calls to Span.context(), this should be the last call made to the span instance, and to do otherwise leads to undefined behavior.
finishMicros
- an explicit finish time, in microseconds since the epochcontext()
void close()
close
in interface AutoCloseable
Span setTag(String key, boolean value)
setTag(String, String)
, but for boolean values.Span setTag(String key, Number value)
setTag(String, String)
, but for numeric values.Span log(String eventName, Object payload)
Span log(long timestampMicroseconds, String eventName, Object payload)
Span setBaggageItem(String key, String value)
String getBaggageItem(String key)
Copyright © 2016 OpenTracing. All rights reserved.