-
public abstract class TracingInterceptor.BaseBuilder<T extends TracingInterceptor, R extends TracingInterceptor.BaseBuilder<T, R>>An abstract Builder class.
-
-
Constructor Summary
Constructors Constructor Description TracingInterceptor.BaseBuilder(Map<String, Set<TracingHeaderType>> tracedHostsWithHeaderType)
-
Method Summary
Modifier and Type Method Description final RsetSdkInstanceName(String sdkInstanceName)Set the SDK instance name to bind to, the default value is null. final RsetTracedRequestListener(TracedRequestListener tracedRequestListener)Set the listener for automatically created AgentSpans. final RsetTraceSampleRate(@FloatRange(from = 0.0.toDouble(), to = 100.0.toDouble()) Float sampleRate)Set the trace sample rate controlling the sampling of APM traces created for auto-instrumented requests. final RsetTraceSampler(Sampler<DatadogSpan> traceSampler)Set the trace sampler controlling the sampling of APM traces created for auto-instrumented requests. final RsetTraceContextInjection(TraceContextInjection traceContextInjection)Set the trace context injection behavior for this interceptor in the intercepted requests. final Rset404ResourcesRedacted(Boolean redacted)Set whether network requests returning a 404 status code should have their resource name redacted. abstract Tbuild()Build the interceptor. -
-
Method Detail
-
setSdkInstanceName
final R setSdkInstanceName(String sdkInstanceName)
Set the SDK instance name to bind to, the default value is null.
- Parameters:
sdkInstanceName- SDK instance name to bind to, the default value is null.
-
setTracedRequestListener
final R setTracedRequestListener(TracedRequestListener tracedRequestListener)
Set the listener for automatically created AgentSpans.
- Parameters:
tracedRequestListener- a listener for automatically created AgentSpans
-
setTraceSampleRate
final R setTraceSampleRate(@FloatRange(from = 0.0.toDouble(), to = 100.0.toDouble()) Float sampleRate)
Set the trace sample rate controlling the sampling of APM traces created for auto-instrumented requests. If there is a parent trace attached to the network span created, then its sampling decision will be used instead.
- Parameters:
sampleRate- the sample rate to use (percentage between 0f and 100f, default is 100f).
-
setTraceSampler
final R setTraceSampler(Sampler<DatadogSpan> traceSampler)
Set the trace sampler controlling the sampling of APM traces created for auto-instrumented requests. If there is a parent trace attached to the network span created, then its sampling decision will be used instead.
- Parameters:
traceSampler- the trace sampler controlling the sampling of APM traces.
-
setTraceContextInjection
final R setTraceContextInjection(TraceContextInjection traceContextInjection)
Set the trace context injection behavior for this interceptor in the intercepted requests. By default this is set to TraceContextInjection.SAMPLED, meaning that only the sampled request will propagate the trace context. In case of TraceContextInjection.ALL all the trace context will be propagated in the intercepted requests no matter if the span created around the request is sampled or not.
- Parameters:
traceContextInjection- the trace context injection option.
-
set404ResourcesRedacted
final R set404ResourcesRedacted(Boolean redacted)
Set whether network requests returning a 404 status code should have their resource name redacted. In order to reduce the cardinality of resource names in APM, 404 URLs are automatically redacted to "404".
- Parameters:
redacted- if true, all 404 requests will have a resource name set to "404", else the resource name will be the URL
-
-
-
-