-
public class DatadogTracingToolkitFor library usage only. Provides implementation for specific interfaces to dependent modules
-
-
Field Summary
Fields Modifier and Type Field Description public final DatadogSpanIdConverterspanIdConverterprivate DatadogPropagationHelperpropagationHelperpublic final static DatadogTracingToolkitINSTANCE
-
Method Summary
Modifier and Type Method Description final UnitsetTracingSamplingPriorityIfNecessary(DatadogSpanContext context)Sets the tracing sampling priority if it is necessary. final DatadogTracerBuildersetTraceId128BitGenerationEnabled(DatadogTracerBuilder builder)Enables 128-bit trace ID generation for the provided Datadog tracer builder. final DatadogTracerBuildersetSdkV2Compatible(DatadogTracerBuilder builder)Enables compatibility mode with SDK v2 for sampling factory strategy. final static UnitaddThrowable(DatadogSpan span, Throwable throwable, Byte errorPriority)Associates a throwable with the current span, marking it as an error. final static DatadogScopeactivateSpan(DatadogTracer tracer, DatadogSpan span, Boolean asyncPropagating)Activates the provided span within the current context of the tracer. final StringmergeBaggage(String oldHeader, String newHeader)Merges two baggage headers into a single string representation. final DatadogSpanIdConvertergetSpanIdConverter()Provides a mechanism for converting Datadog span IDs between decimal and hexadecimal representations. final DatadogPropagationHelpergetPropagationHelper()Providing helper function to extract DatadogSpanContext from tracing context added by addParentSpan method. final UnitsetPropagationHelper(DatadogPropagationHelper propagationHelper)-
-
Method Detail
-
setTracingSamplingPriorityIfNecessary
final Unit setTracingSamplingPriorityIfNecessary(DatadogSpanContext context)
Sets the tracing sampling priority if it is necessary.
-
setTraceId128BitGenerationEnabled
final DatadogTracerBuilder setTraceId128BitGenerationEnabled(DatadogTracerBuilder builder)
Enables 128-bit trace ID generation for the provided Datadog tracer builder.
-
setSdkV2Compatible
final DatadogTracerBuilder setSdkV2Compatible(DatadogTracerBuilder builder)
Enables compatibility mode with SDK v2 for sampling factory strategy.
-
addThrowable
final static Unit addThrowable(DatadogSpan span, Throwable throwable, Byte errorPriority)
Associates a throwable with the current span, marking it as an error. Note that error flag will be set only if priority is higher than the current one.
- Parameters:
span- The span to associate the throwable with.throwable- The throwable to associate with the current span.errorPriority- The priority level of the error, represented as a byte.
-
activateSpan
final static DatadogScope activateSpan(DatadogTracer tracer, DatadogSpan span, Boolean asyncPropagating)
Activates the provided span within the current context of the tracer. If
asyncPropagatingis set to true, the span is propagated asynchronously. Once activated, the span becomes the currently active span until it is explicitly deactivated.- Parameters:
tracer- The tracer instance to be used for activation.span- The span to be activated.asyncPropagating- If true, this context will propagate across async boundaries.
-
mergeBaggage
final String mergeBaggage(String oldHeader, String newHeader)
Merges two baggage headers into a single string representation. The oldHeader represents the previously existing baggage header, and the newHeader represents the new baggage information to be merged with the old one.
- Parameters:
oldHeader- The existing baggage header, which may be null.newHeader- The new baggage header to be merged, must not be null.
-
getSpanIdConverter
final DatadogSpanIdConverter getSpanIdConverter()
Provides a mechanism for converting Datadog span IDs between decimal and hexadecimal representations.
This converter is utilized to ensure span ID consistency and proper formatting for distributed tracing when working with the Datadog SDK.
-
getPropagationHelper
final DatadogPropagationHelper getPropagationHelper()
Providing helper function to extract DatadogSpanContext from tracing context added by addParentSpan method.
This property is intended for internal usage only and should not be altered externally.
-
setPropagationHelper
final Unit setPropagationHelper(DatadogPropagationHelper propagationHelper)
-
-
-
-