public abstract class AbstractTracingSpan extends Object implements AbstractSpan
AbstractTracingSpan represents a group of AbstractSpan implementations, which belongs a real
distributed trace.| Modifier and Type | Field and Description |
|---|---|
protected int |
componentId |
protected String |
componentName |
protected AbstractTracerContext |
context |
protected long |
endTime
The end time of this Span.
|
protected boolean |
errorOccurred
Error has occurred in the scope of span.
|
protected boolean |
isInAsyncMode
The span has been tagged in async mode, required async stop to finish.
|
protected SpanLayer |
layer |
protected List<LogDataEntity> |
logs
Log is a concept from OpenTracing spec.
|
protected int |
operationId |
protected String |
operationName |
protected int |
parentSpanId |
protected List<TraceSegmentRef> |
refs
The refs of parent trace segments, except the primary one.
|
protected int |
spanId |
protected long |
startTime
The start time of this Span.
|
protected List<TagValuePair> |
tags |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractTracingSpan(int spanId,
int parentSpanId,
int operationId) |
protected |
AbstractTracingSpan(int spanId,
int parentSpanId,
String operationName) |
| Modifier and Type | Method and Description |
|---|---|
AbstractSpan |
asyncFinish()
Notify the span, it could be finished.
|
AbstractTracingSpan |
errorOccurred()
In the scope of this span tracing context, error occurred, in auto-instrumentation mechanism, almost means throw
an exception.
|
boolean |
finish(TraceSegment owner)
Finish the active Span.
|
int |
getOperationId() |
String |
getOperationName() |
int |
getSpanId()
Get the id of span
|
AbstractTracingSpan |
log(long timestampMicroseconds,
Map<String,?> fields)
Record a common log with multi fields, for supporting opentracing-java
|
AbstractTracingSpan |
log(Throwable t)
Record an exception event of the current walltime timestamp.
|
AbstractSpan |
prepareForAsync()
The span finish at current tracing context, but the current span is still alive, until
AsyncSpan.asyncFinish()
called. |
void |
ref(TraceSegmentRef ref)
Reference other trace segment.
|
AbstractTracingSpan |
setComponent(Component component)
Set the component of this span, with internal supported.
|
AbstractTracingSpan |
setComponent(String componentName)
Set the component name.
|
AbstractTracingSpan |
setLayer(SpanLayer layer) |
AbstractTracingSpan |
setOperationId(int operationId)
Set the operation id, which compress by the name.
|
AbstractTracingSpan |
setOperationName(String operationName)
Set the operation name, just because these is not compress dictionary value for this name.
|
AbstractTracingSpan |
start()
Start a span.
|
AbstractSpan |
start(long startTime) |
AbstractTracingSpan |
tag(AbstractTag tag,
String value) |
AbstractTracingSpan |
tag(String key,
String value)
Deprecated.
|
SpanObjectV2.Builder |
transform() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisEntry, isExit, setPeerprotected int spanId
protected int parentSpanId
protected List<TagValuePair> tags
protected String operationName
protected int operationId
protected SpanLayer layer
protected volatile boolean isInAsyncMode
protected volatile AbstractTracerContext context
protected long startTime
protected long endTime
protected boolean errorOccurred
protected int componentId
protected String componentName
protected List<LogDataEntity> logs
protected List<TraceSegmentRef> refs
protected AbstractTracingSpan(int spanId,
int parentSpanId,
String operationName)
protected AbstractTracingSpan(int spanId,
int parentSpanId,
int operationId)
@Deprecated public AbstractTracingSpan tag(String key, String value)
tag in interface AbstractSpanpublic AbstractTracingSpan tag(AbstractTag tag, String value)
tag in interface AbstractSpanpublic boolean finish(TraceSegment owner)
TraceSegment, which owners
it.owner - of the Span.public AbstractTracingSpan start()
AbstractSpanstart in interface AbstractSpanpublic AbstractTracingSpan log(Throwable t)
log in interface AbstractSpant - any subclass of Throwable, which occurs in this span.public AbstractTracingSpan log(long timestampMicroseconds, Map<String,?> fields)
log in interface AbstractSpanfields - timestampMicroseconds - The explicit timestamp for the log record.public AbstractTracingSpan errorOccurred()
errorOccurred in interface AbstractSpanpublic AbstractTracingSpan setOperationName(String operationName)
setOperationName in interface AbstractSpanoperationName - public AbstractTracingSpan setOperationId(int operationId)
setOperationId in interface AbstractSpanoperationId - public int getSpanId()
AbstractSpangetSpanId in interface AbstractSpanpublic int getOperationId()
getOperationId in interface AbstractSpanpublic String getOperationName()
getOperationName in interface AbstractSpanpublic AbstractTracingSpan setLayer(SpanLayer layer)
setLayer in interface AbstractSpanpublic AbstractTracingSpan setComponent(Component component)
setComponent in interface AbstractSpancomponent - public AbstractTracingSpan setComponent(String componentName)
setComponent in interface AbstractSpancomponentName - public AbstractSpan start(long startTime)
start in interface AbstractSpanpublic SpanObjectV2.Builder transform()
public void ref(TraceSegmentRef ref)
AbstractSpanref in interface AbstractSpanref - segment refpublic AbstractSpan prepareForAsync()
AsyncSpanAsyncSpan.asyncFinish()
called.
This method must be called
1. In original thread(tracing context).
2. Current span is active span.
During alive, tags, logs and attributes of the span could be changed, in any thread.
The execution times of AsyncSpan.prepareForAsync() and AsyncSpan.asyncFinish() must match.prepareForAsync in interface AsyncSpanpublic AbstractSpan asyncFinish()
AsyncSpanAsyncSpan.prepareForAsync() and AsyncSpan.asyncFinish() must match.asyncFinish in interface AsyncSpanCopyright © 2019 The Apache Software Foundation. All rights reserved.