public class NoopSpan extends Object implements AbstractSpan
NoopSpan represents a span implementation without any actual operation.
This span implementation is for IgnoredTracerContext,
for keeping the memory and gc cost as low as possible.| Constructor and Description |
|---|
NoopSpan() |
| Modifier and Type | Method and Description |
|---|---|
AbstractSpan |
asyncFinish()
Notify the span, it could be finished.
|
AbstractSpan |
errorOccurred() |
void |
finish() |
int |
getOperationId() |
String |
getOperationName() |
int |
getSpanId()
Get the id of span
|
boolean |
isEntry() |
boolean |
isExit() |
AbstractSpan |
log(long timestamp,
Map<String,?> event)
Record an event at a specific timestamp.
|
AbstractSpan |
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.
|
AbstractSpan |
setComponent(Component component)
Set the component id, which defines in
ComponentsDefine |
AbstractSpan |
setComponent(String componentName)
Only use this method in explicit instrumentation, like opentracing-skywalking-bridge.
|
AbstractSpan |
setLayer(SpanLayer layer) |
AbstractSpan |
setOperationId(int operationId) |
AbstractSpan |
setOperationName(String operationName)
Sets the string name for the logical operation this span represents.
|
AbstractSpan |
setPeer(String remotePeer) |
AbstractSpan |
start()
Start a span.
|
AbstractSpan |
start(long startTime) |
AbstractSpan |
tag(AbstractTag tag,
String value) |
AbstractSpan |
tag(String key,
String value)
Set a key:value tag on the Span.
|
public AbstractSpan log(Throwable t)
AbstractSpanlog in interface AbstractSpant - any subclass of Throwable, which occurs in this span.public AbstractSpan errorOccurred()
errorOccurred in interface AbstractSpanpublic void finish()
public AbstractSpan setComponent(Component component)
AbstractSpanComponentsDefinesetComponent in interface AbstractSpanpublic AbstractSpan setComponent(String componentName)
AbstractSpansetComponent in interface AbstractSpanpublic AbstractSpan setLayer(SpanLayer layer)
setLayer in interface AbstractSpanpublic AbstractSpan tag(String key, String value)
AbstractSpantag in interface AbstractSpanpublic AbstractSpan tag(AbstractTag tag, String value)
tag in interface AbstractSpanpublic boolean isEntry()
isEntry in interface AbstractSpanpublic boolean isExit()
isExit in interface AbstractSpanpublic AbstractSpan log(long timestamp, Map<String,?> event)
AbstractSpanlog in interface AbstractSpantimestamp - The explicit timestamp for the log record.event - the eventspublic AbstractSpan setOperationName(String operationName)
AbstractSpansetOperationName in interface AbstractSpanpublic AbstractSpan start()
AbstractSpanstart in interface AbstractSpanpublic int getSpanId()
AbstractSpangetSpanId in interface AbstractSpanpublic int getOperationId()
getOperationId in interface AbstractSpanpublic String getOperationName()
getOperationName in interface AbstractSpanpublic AbstractSpan setOperationId(int operationId)
setOperationId in interface AbstractSpanpublic void ref(TraceSegmentRef ref)
AbstractSpanref in interface AbstractSpanref - segment refpublic AbstractSpan start(long startTime)
start in interface AbstractSpanpublic AbstractSpan setPeer(String remotePeer)
setPeer in interface AbstractSpanpublic 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.