public class TraceSegment extends Object
TraceSegment is a segment or fragment of the distributed trace. See https://github.com/opentracing/specification/blob/master/specification.md#the-opentracing-data-model
A TraceSegment means the segment, which exists in current Thread. And the distributed trace is formed
by multi TraceSegments, because the distributed trace crosses multi-processes, multi-threads. | Constructor and Description |
|---|
TraceSegment()
Create a default/empty trace segment, with current time as start time, and generate a new segment id.
|
| Modifier and Type | Method and Description |
|---|---|
void |
archive(AbstractTracingSpan finishedSpan)
After
AbstractSpan is finished, as be controller by "skywalking-api" module, notify the TraceSegment to archive it. |
long |
createTime() |
TraceSegment |
finish(boolean isSizeLimited)
Finish this
TraceSegment. |
int |
getApplicationInstanceId() |
List<TraceSegmentRef> |
getRefs() |
List<DistributedTraceId> |
getRelatedGlobalTraces() |
int |
getServiceId() |
ID |
getTraceSegmentId() |
boolean |
hasRef() |
boolean |
isIgnore() |
boolean |
isSingleSpanSegment() |
void |
ref(TraceSegmentRef refSegment)
Establish the link between this segment and its parents.
|
void |
relatedGlobalTraces(DistributedTraceId distributedTraceId)
Establish the line between this segment and all relative global trace ids.
|
void |
setIgnore(boolean ignore) |
String |
toString() |
UpstreamSegment |
transform()
This is a high CPU cost method, only called when sending to collector or test cases.
|
public TraceSegment()
public void ref(TraceSegmentRef refSegment)
refSegment - TraceSegmentRefpublic void relatedGlobalTraces(DistributedTraceId distributedTraceId)
public void archive(AbstractTracingSpan finishedSpan)
AbstractSpan is finished, as be controller by "skywalking-api" module, notify the TraceSegment to archive it.finishedSpan - public TraceSegment finish(boolean isSizeLimited)
TraceSegment. return this, for chaining
public ID getTraceSegmentId()
public int getServiceId()
public boolean hasRef()
public List<TraceSegmentRef> getRefs()
public List<DistributedTraceId> getRelatedGlobalTraces()
public boolean isSingleSpanSegment()
public boolean isIgnore()
public void setIgnore(boolean ignore)
public UpstreamSegment transform()
public int getApplicationInstanceId()
public long createTime()
Copyright © 2019 The Apache Software Foundation. All rights reserved.