Package 

Class TracingInterceptor.BaseBuilder

    • Method Summary

      Modifier and Type Method Description
      final R setSdkInstanceName(String sdkInstanceName) Set the SDK instance name to bind to, the default value is null.
      final R setTracedRequestListener(TracedRequestListener tracedRequestListener) Set the listener for automatically created AgentSpans.
      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.
      final R setTraceSampler(Sampler<DatadogSpan> traceSampler) Set the trace sampler controlling the sampling of APM traces created for auto-instrumented requests.
      final R setTraceContextInjection(TraceContextInjection traceContextInjection) Set the trace context injection behavior for this interceptor in the intercepted requests.
      final R set404ResourcesRedacted(Boolean redacted) Set whether network requests returning a 404 status code should have their resource name redacted.
      abstract T build() Build the interceptor.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TracingInterceptor.BaseBuilder

        TracingInterceptor.BaseBuilder(Map<String, Set<TracingHeaderType>> tracedHostsWithHeaderType)
    • 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
      • build

         abstract T build()

        Build the interceptor.