-
- All Implemented Interfaces:
-
io.opentracing.SpanContext
public class DDSpanContext implements SpanContextSpanContext represents Span state that must propagate to descendant Spans and across process boundaries.
SpanContext is logically divided into two pieces: (1) the user-level "Baggage" that propagates across Span boundaries and (2) any Datadog fields that are needed to identify or contextualize the associated Span instance
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringPRIORITY_SAMPLING_KEYpublic final static StringSAMPLE_RATE_KEYpublic final static StringORIGIN_KEYprivate final DDTracertracerprivate final PendingTracetraceprivate final Map<String, String>baggageItemsprivate final BigIntegertraceIdprivate final BigIntegerspanIdprivate final BigIntegerparentIdprivate final Map<String, Object>tagsprivate volatile StringserviceNameprivate volatile StringresourceNameprivate volatile StringoperationNameprivate volatile StringspanTypeprivate volatile booleanerrorFlagprivate final Stringorigin
-
Constructor Summary
Constructors Constructor Description DDSpanContext(BigInteger traceId, BigInteger spanId, BigInteger parentId, String serviceName, String operationName, String resourceName, int samplingPriority, String origin, Map<String, String> baggageItems, boolean errorFlag, String spanType, Map<String, Object> tags, PendingTrace trace, DDTracer tracer, Map<String, String> serviceNameMappings)
-
Method Summary
-
-
Constructor Detail
-
DDSpanContext
DDSpanContext(BigInteger traceId, BigInteger spanId, BigInteger parentId, String serviceName, String operationName, String resourceName, int samplingPriority, String origin, Map<String, String> baggageItems, boolean errorFlag, String spanType, Map<String, Object> tags, PendingTrace trace, DDTracer tracer, Map<String, String> serviceNameMappings)
-
-
Method Detail
-
getTracer
@Deprecated() DDTracer getTracer()
-
getTrace
PendingTrace getTrace()
-
getBaggageItems
Map<String, String> getBaggageItems()
-
getTraceId
BigInteger getTraceId()
-
getSpanId
BigInteger getSpanId()
-
getParentId
BigInteger getParentId()
-
getServiceName
String getServiceName()
-
setServiceName
void setServiceName(String serviceName)
-
getResourceName
String getResourceName()
-
setResourceName
void setResourceName(String resourceName)
-
getOperationName
String getOperationName()
-
setOperationName
void setOperationName(String operationName)
-
getSpanType
String getSpanType()
-
setSpanType
void setSpanType(String spanType)
-
getErrorFlag
boolean getErrorFlag()
-
setErrorFlag
void setErrorFlag(boolean errorFlag)
-
isResourceNameSet
boolean isResourceNameSet()
-
hasResourceName
boolean hasResourceName()
-
setSamplingPriority
boolean setSamplingPriority(int newPriority)
-
getSamplingPriority
int getSamplingPriority()
-
lockSamplingPriority
boolean lockSamplingPriority()
Prevent future changes to the context's sampling priority.
Used when a span is extracted or injected for propagation.
Has no effect if the sampling priority is unset.
-
setBaggageItem
void setBaggageItem(String key, String value)
-
getBaggageItem
String getBaggageItem(String key)
-
baggageItems
Iterable<Map.Entry<String, String>> baggageItems()
-
setTag
synchronized void setTag(String tag, Object value)
Add a tag to the span. Tags are not propagated to the children
- Parameters:
tag- the tag-namevalue- the value of the tag.
-
-
-
-