-
- All Implemented Interfaces:
-
com.datadog.trace.api.gateway.IGSpanInfo,com.datadog.trace.api.interceptor.MutableSpan
public interface AgentSpan implements MutableSpan, IGSpanInfo
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceAgentSpan.Context
-
Method Summary
Modifier and Type Method Description abstract DDTraceIdgetTraceId()abstract longgetSpanId()abstract AgentSpansetTag(String key, boolean value)abstract AgentSpansetTag(String key, int value)abstract AgentSpansetTag(String key, long value)abstract AgentSpansetTag(String key, double value)abstract AgentSpansetTag(String key, String value)abstract AgentSpansetTag(String key, CharSequence value)abstract AgentSpansetTag(String key, Object value)abstract AgentSpansetTag(String key, Number value)abstract AgentSpansetMetric(CharSequence key, int value)abstract AgentSpansetMetric(CharSequence key, long value)abstract AgentSpansetMetric(CharSequence key, double value)abstract AgentSpansetSpanType(CharSequence type)abstract ObjectgetTag(String key)abstract AgentSpansetError(boolean error)abstract AgentSpansetError(boolean error, byte priority)abstract AgentSpansetMeasured(boolean measured)abstract AgentSpansetErrorMessage(String errorMessage)abstract AgentSpanaddThrowable(Throwable throwable)abstract AgentSpanaddThrowable(Throwable throwable, byte errorPriority)abstract AgentSpangetLocalRootSpan()Returns the root span for current the trace fragment. abstract booleanisSameTrace(AgentSpan otherSpan)abstract AgentSpan.Contextcontext()abstract StringgetBaggageItem(String key)abstract AgentSpansetBaggageItem(String key, String value)abstract AgentSpansetHttpStatusCode(int statusCode)abstract shortgetHttpStatusCode()abstract voidfinish()abstract voidfinish(long finishMicros)abstract voidfinishWithDuration(long durationNanos)abstract voidbeginEndToEnd()Marks the start of a message pipeline where we want to track end-to-end processing time. abstract voidfinishWithEndToEnd()Marks the end of a message pipeline where the final end-to-end processing time is recorded. abstract booleanphasedFinish()Finishes the span but does not publish it. abstract voidpublish()Publish a span that was previously finished by calling phasedFinish. abstract CharSequencegetSpanName()abstract voidsetSpanName(CharSequence spanName)abstract booleanhasResourceName()Deprecated in favor of setResourceName(final CharSequence resourceName, byte priority) or usinggetResourceNamePriority() for comparisons. abstract bytegetResourceNamePriority()abstract AgentSpansetResourceName(CharSequence resourceName)abstract AgentSpansetResourceName(CharSequence resourceName, byte priority)Implementation note: two calls with the same priority will result in the second resource namebeing used abstract booleaneligibleForDropping()abstract RequestContextgetRequestContext()RequestContext for the Instrumentation Gateway abstract IntegerforceSamplingDecision()abstract AgentSpansetSamplingPriority(int newPriority, int samplingMechanism)abstract TraceConfigtraceConfig()abstract voidaddLink(AgentSpanLink link)-
Methods inherited from class com.datadog.trace.api.interceptor.MutableSpan
getDurationNano, getLocalRootSpan, getOperationName, getResourceName, getRootSpan, getSamplingPriority, getServiceName, getSpanType, getStartTime, getTags, isError, setError, setMetric, setMetric, setMetric, setOperationName, setResourceName, setSamplingPriority, setServiceName, setSpanType, setTag, setTag, setTag -
Methods inherited from class com.datadog.trace.api.gateway.IGSpanInfo
getRequestBlockingAction, setRequestBlockingAction -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getTraceId
abstract DDTraceId getTraceId()
-
getSpanId
abstract long getSpanId()
-
setTag
abstract AgentSpan setTag(String key, CharSequence value)
-
setMetric
abstract AgentSpan setMetric(CharSequence key, int value)
-
setMetric
abstract AgentSpan setMetric(CharSequence key, long value)
-
setMetric
abstract AgentSpan setMetric(CharSequence key, double value)
-
setSpanType
abstract AgentSpan setSpanType(CharSequence type)
-
setMeasured
abstract AgentSpan setMeasured(boolean measured)
-
setErrorMessage
abstract AgentSpan setErrorMessage(String errorMessage)
-
addThrowable
abstract AgentSpan addThrowable(Throwable throwable)
-
addThrowable
abstract AgentSpan addThrowable(Throwable throwable, byte errorPriority)
-
getLocalRootSpan
abstract AgentSpan getLocalRootSpan()
Returns the root span for current the trace fragment. In the context of distributed tracingthis method returns the root span only for the fragment generated by the currently tracedapplication.
-
isSameTrace
abstract boolean isSameTrace(AgentSpan otherSpan)
-
context
abstract AgentSpan.Context context()
-
getBaggageItem
abstract String getBaggageItem(String key)
-
setBaggageItem
abstract AgentSpan setBaggageItem(String key, String value)
-
setHttpStatusCode
abstract AgentSpan setHttpStatusCode(int statusCode)
-
getHttpStatusCode
abstract short getHttpStatusCode()
-
finish
abstract void finish()
-
finish
abstract void finish(long finishMicros)
-
finishWithDuration
abstract void finishWithDuration(long durationNanos)
-
beginEndToEnd
abstract void beginEndToEnd()
Marks the start of a message pipeline where we want to track end-to-end processing time.
-
finishWithEndToEnd
abstract void finishWithEndToEnd()
Marks the end of a message pipeline where the final end-to-end processing time is recorded.
Note: this will also finish the span and publish it.
-
phasedFinish
abstract boolean phasedFinish()
Finishes the span but does not publish it. The publish method MUST be called onceotherwise the trace will not be reported.
-
publish
abstract void publish()
Publish a span that was previously finished by calling phasedFinish. Must be calledonce and only once per span.
-
getSpanName
abstract CharSequence getSpanName()
-
setSpanName
abstract void setSpanName(CharSequence spanName)
-
hasResourceName
@Deprecated() abstract boolean hasResourceName()
Deprecated in favor of setResourceName(final CharSequence resourceName, byte priority) or usinggetResourceNamePriority() for comparisons.
-
getResourceNamePriority
abstract byte getResourceNamePriority()
-
setResourceName
abstract AgentSpan setResourceName(CharSequence resourceName)
-
setResourceName
abstract AgentSpan setResourceName(CharSequence resourceName, byte priority)
Implementation note: two calls with the same priority will result in the second resource namebeing used
-
eligibleForDropping
abstract boolean eligibleForDropping()
-
getRequestContext
abstract RequestContext getRequestContext()
RequestContext for the Instrumentation Gateway
-
forceSamplingDecision
abstract Integer forceSamplingDecision()
-
setSamplingPriority
abstract AgentSpan setSamplingPriority(int newPriority, int samplingMechanism)
-
traceConfig
abstract TraceConfig traceConfig()
-
addLink
abstract void addLink(AgentSpanLink link)
-
-
-
-