-
- All Implemented Interfaces:
-
com.datadog.trace.api.interceptor.MutableSpan,io.opentracing.Span
public class DDSpan implements Span, MutableSpan
Represents a period of time. Associated information is stored in the SpanContext.
Spans are created by the buildSpan. This implementation adds some features according to the DD agent.
-
-
Method Summary
Modifier and Type Method Description booleanisFinished()final voidfinish()final voidfinish(long stoptimeMicros)DDSpansetError(boolean error)final voiddrop()By calling this method the span will be removed from the current active Trace withoutactually being persisted.Note: This method is meant for internal SDK usage. final booleanisRootSpan()Check if the span is the root parent. MutableSpangetRootSpan()MutableSpangetLocalRootSpan()Returns the root span for current the trace fragment. voidsetErrorMeta(Throwable error)final DDSpansetTag(String tag, String value)final DDSpansetTag(String tag, boolean value)final DDSpansetTag(String tag, Number value)<T> SpansetTag(Tag<T> tag, T value)final DDSpanContextcontext()final StringgetBaggageItem(String key)final DDSpansetBaggageItem(String key, String value)final DDSpansetOperationName(String operationName)final DDSpanlog(Map<String, out Object> map)final DDSpanlog(long l, Map<String, out Object> map)final DDSpanlog(String s)final DDSpanlog(long l, String s)final DDSpansetServiceName(String serviceName)final DDSpansetResourceName(String resourceName)final DDSpansetSamplingPriority(int newPriority)Set the sampling priority of the root span of this span's traceHas no effect if the span priority has been propagated (injected or extracted). final DDSpansetSpanType(String type)Map<String, String>getMeta()Meta merges baggage and tags (stringified values) Map<String, Number>getMetrics()Span metrics. longgetStartTime()StringgetServiceName()BigIntegergetTraceId()BigIntegergetSpanId()BigIntegergetParentId()StringgetResourceName()StringgetOperationName()IntegergetSamplingPriority()StringgetSpanType()Map<String, Object>getTags()StringgetType()BooleanisError()intgetError()StringtoString()-
Methods inherited from class io.opentracing.Span
context, finish, getBaggageItem, log, setBaggageItem, setOperationName, setTag -
Methods inherited from class com.datadog.trace.api.interceptor.MutableSpan
setError, setOperationName, setResourceName, setSamplingPriority, setServiceName, setSpanType, setTag, setTag, setTag -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
isFinished
boolean isFinished()
-
finish
final void finish()
-
finish
final void finish(long stoptimeMicros)
-
drop
final void drop()
By calling this method the span will be removed from the current active Trace withoutactually being persisted.Note: This method is meant for internal SDK usage. Be aware that if used this Span willbe removed from the Trace and lost.
-
isRootSpan
final boolean isRootSpan()
Check if the span is the root parent. It means that the traceId is the same as the spanId. Inthe context of distributed tracing this will return true if an only if this is the applicationinitializing the trace.
-
getRootSpan
@Deprecated() MutableSpan getRootSpan()
-
getLocalRootSpan
MutableSpan 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.
-
setErrorMeta
void setErrorMeta(Throwable error)
-
setTag
<T> Span setTag(Tag<T> tag, T value)
-
context
final DDSpanContext context()
-
getBaggageItem
final String getBaggageItem(String key)
-
setBaggageItem
final DDSpan setBaggageItem(String key, String value)
-
setOperationName
final DDSpan setOperationName(String operationName)
-
setServiceName
final DDSpan setServiceName(String serviceName)
-
setResourceName
final DDSpan setResourceName(String resourceName)
-
setSamplingPriority
final DDSpan setSamplingPriority(int newPriority)
Set the sampling priority of the root span of this span's trace
Has no effect if the span priority has been propagated (injected or extracted).
-
setSpanType
final DDSpan setSpanType(String type)
-
getMetrics
Map<String, Number> getMetrics()
Span metrics.
-
getStartTime
long getStartTime()
-
getServiceName
String getServiceName()
-
getTraceId
BigInteger getTraceId()
-
getSpanId
BigInteger getSpanId()
-
getParentId
BigInteger getParentId()
-
getResourceName
String getResourceName()
-
getOperationName
String getOperationName()
-
getSamplingPriority
Integer getSamplingPriority()
-
getSpanType
String getSpanType()
-
getError
int getError()
-
-
-
-