public class APMSpan extends Object implements PropagableState
| Constructor and Description |
|---|
APMSpan(APMSpanBuilder builder,
TraceRecorder recorder,
ContextSampler sampler) |
| Modifier and Type | Method and Description |
|---|---|
Iterable<Map.Entry<String,String>> |
baggageItems() |
void |
close() |
io.opentracing.SpanContext |
context() |
static io.opentracing.impl.AbstractSpanBuilder.Reference |
findPrimaryReference(List<io.opentracing.impl.AbstractSpanBuilder.Reference> references)
This method identifies the primary 'parent' reference that should be used
to link the associated span to an existing trace instance.
|
void |
finish() |
void |
finish(long finishMicros) |
Map<String,String> |
getBaggage() |
String |
getBaggageItem(String arg0) |
Duration |
getDuration() |
protected String |
getInteractionId() |
List<io.opentracing.impl.AbstractSpan.LogData> |
getLogs() |
protected NodeBuilder |
getNodeBuilder()
This method returns the node builder associated with the span.
|
protected String |
getNodePath() |
String |
getOperationName() |
Instant |
getStart() |
Map<String,Object> |
getTags() |
protected TraceContext |
getTraceContext()
This method returns the trace context associated with the span.
|
protected void |
init(APMSpanBuilder builder,
TraceRecorder recorder,
ContextSampler sampler) |
protected void |
initChildOf(APMSpanBuilder builder,
io.opentracing.impl.AbstractSpanBuilder.Reference ref)
This method initialises the span based on a 'child-of' relationship.
|
protected void |
initFollowsFrom(APMSpanBuilder builder,
TraceRecorder recorder,
io.opentracing.impl.AbstractSpanBuilder.Reference ref,
ContextSampler sampler)
This method initialises the span based on a 'follows-from' relationship.
|
protected void |
initFromExtractedTraceState(APMSpanBuilder builder,
TraceRecorder recorder,
io.opentracing.impl.AbstractSpanBuilder.Reference ref,
ContextSampler sampler)
This method initialises the span based on extracted trace state.
|
protected void |
initReferences(APMSpanBuilder builder,
TraceRecorder recorder,
ContextSampler sampler) |
protected void |
initTopLevelState(APMSpan topSpan,
TraceRecorder recorder,
ContextSampler sampler)
This method initialises the node builder and trace context for a top level
trace fragment.
|
io.opentracing.Span |
log(long arg0,
Map<String,?> arg1) |
io.opentracing.Span |
log(long arg0,
String arg1) |
io.opentracing.Span |
log(long arg0,
String arg1,
Object arg2) |
io.opentracing.Span |
log(Map<String,?> arg0) |
io.opentracing.Span |
log(String arg0) |
io.opentracing.Span |
log(String arg0,
Object arg1) |
protected void |
makeInternalLink(APMSpanBuilder builder)
This method creates a Consumer node to link the new trace fragment to a
node associated with a referenced Span.
|
protected void |
processNoPrimaryReference(APMSpanBuilder builder,
TraceRecorder recorder,
ContextSampler sampler)
This method initialises the span based on there being no primary reference.
|
protected void |
processRemainingReferences(APMSpanBuilder builder,
io.opentracing.impl.AbstractSpanBuilder.Reference primaryRef)
This method processes the remaining references by creating appropriate correlation ids
against the current node.
|
io.opentracing.impl.AbstractSpan |
setBaggageItem(String arg0,
String arg1) |
protected void |
setInteractionId(String id) |
io.opentracing.Span |
setOperationName(String arg0) |
io.opentracing.Span |
setTag(String arg0,
boolean arg1) |
io.opentracing.Span |
setTag(String arg0,
Number arg1) |
io.opentracing.Span |
setTag(String arg0,
String arg1) |
Map<String,Object> |
state()
State properties defining span(or APM trace fragment) state.
|
public APMSpan(APMSpanBuilder builder, TraceRecorder recorder, ContextSampler sampler)
builder - The span builderrecorder - The trace recorderprotected void init(APMSpanBuilder builder, TraceRecorder recorder, ContextSampler sampler)
protected void initReferences(APMSpanBuilder builder, TraceRecorder recorder, ContextSampler sampler)
public static io.opentracing.impl.AbstractSpanBuilder.Reference findPrimaryReference(List<io.opentracing.impl.AbstractSpanBuilder.Reference> references)
references - The list of referencesprotected void initTopLevelState(APMSpan topSpan, TraceRecorder recorder, ContextSampler sampler)
topSpan - The top level span in the tracerecorder - The trace recordersampler - The samplerprotected void initFromExtractedTraceState(APMSpanBuilder builder, TraceRecorder recorder, io.opentracing.impl.AbstractSpanBuilder.Reference ref, ContextSampler sampler)
builder - The span builderrecorder - The trace recorderref - The referencesampler - The samplerprotected void initChildOf(APMSpanBuilder builder, io.opentracing.impl.AbstractSpanBuilder.Reference ref)
builder - The span builderref - The 'child-of' relationshipprotected void initFollowsFrom(APMSpanBuilder builder, TraceRecorder recorder, io.opentracing.impl.AbstractSpanBuilder.Reference ref, ContextSampler sampler)
builder - The span builderrecorder - The trace recorderref - The 'follows-from' relationshipsampler - The samplerprotected void processNoPrimaryReference(APMSpanBuilder builder, TraceRecorder recorder, ContextSampler sampler)
builder - The span builderrecorder - The trace recordersampler - The samplerprotected void processRemainingReferences(APMSpanBuilder builder, io.opentracing.impl.AbstractSpanBuilder.Reference primaryRef)
builder - The span builderprimaryRef - The primary reference, if null if one was not foundprotected void makeInternalLink(APMSpanBuilder builder)
builder - The span builderprotected void setInteractionId(String id)
protected String getInteractionId()
protected String getNodePath()
public void finish()
finish in interface io.opentracing.Spanpublic void finish(long finishMicros)
finish in interface io.opentracing.Spanprotected NodeBuilder getNodeBuilder()
protected TraceContext getTraceContext()
public Map<String,Object> state()
PropagableStatestate in interface PropagableStatepublic final io.opentracing.SpanContext context()
context in interface io.opentracing.Spanpublic final String getOperationName()
public io.opentracing.Span setOperationName(String arg0)
setOperationName in interface io.opentracing.Spanpublic final Instant getStart()
public final Duration getDuration()
public final void close()
close in interface io.opentracing.Spanclose in interface Closeableclose in interface AutoCloseablepublic final io.opentracing.Span setTag(String arg0, String arg1)
setTag in interface io.opentracing.Spanpublic final io.opentracing.Span setTag(String arg0, boolean arg1)
setTag in interface io.opentracing.Spanpublic final io.opentracing.Span setTag(String arg0, Number arg1)
setTag in interface io.opentracing.Spanpublic io.opentracing.impl.AbstractSpan setBaggageItem(String arg0, String arg1)
setBaggageItem in interface io.opentracing.Spanpublic String getBaggageItem(String arg0)
getBaggageItem in interface io.opentracing.Spanpublic final Iterable<Map.Entry<String,String>> baggageItems()
baggageItems in interface io.opentracing.SpanContextpublic final io.opentracing.Span log(String arg0)
log in interface io.opentracing.Spanpublic final io.opentracing.Span log(long arg0,
String arg1)
log in interface io.opentracing.Spanpublic final io.opentracing.Span log(Map<String,?> arg0)
log in interface io.opentracing.Spanpublic final io.opentracing.Span log(long arg0,
Map<String,?> arg1)
log in interface io.opentracing.Spanpublic final io.opentracing.Span log(String arg0, Object arg1)
log in interface io.opentracing.Spanpublic final io.opentracing.Span log(long arg0,
String arg1,
Object arg2)
log in interface io.opentracing.Spanpublic final List<io.opentracing.impl.AbstractSpan.LogData> getLogs()
Copyright © 2015–2017 Red Hat, Inc.. All rights reserved.