-
public interface DatadogTracerBuilderBuilder interface for creating and configuring a DatadogTracer instance.
-
-
Method Summary
Modifier and Type Method Description abstract DatadogTracerbuild()Constructs and returns an instance of DatadogTracer based on the current builder configuration. abstract DatadogTracerBuilderwithTracingHeadersTypes(Set<TracingHeaderType> tracingHeadersTypes)Configures the builder with the specified set of tracing header types. abstract DatadogTracerBuilderwithServiceName(String serviceName)Sets the service name for the tracer. abstract DatadogTracerBuilderwithSampleRate(@FloatRange(from = 0.0.toDouble(), to = 100.0.toDouble()) Double sampleRate)Sets the sample rate of spans. abstract DatadogTracerBuilderwithPartialFlushMinSpans(Integer partialFlushMinSpans)Configures the builder to enable partial flushes when the number of spans in a specific trace reaches the given threshold. abstract DatadogTracerBuilderwithTag(String key, String value)Adds a global tag which will be appended to all spans created with the built tracer. abstract DatadogTracerBuildersetBundleWithRumEnabled(Boolean enabled)Enables the trace bundling with the current active RUM View. abstract DatadogTracerBuildersetTraceRateLimit(@IntRange(from = 1.toLong(), to = 2147483647.toLong()) Integer traceRateLimit)Sets the trace rate limit. -
-
Method Detail
-
build
abstract DatadogTracer build()
Constructs and returns an instance of DatadogTracer based on the current builder configuration.
-
withTracingHeadersTypes
abstract DatadogTracerBuilder withTracingHeadersTypes(Set<TracingHeaderType> tracingHeadersTypes)
Configures the builder with the specified set of tracing header types. Tracing headers define the standards used for propagating trace information across different components.
- Parameters:
tracingHeadersTypes- A set of TracingHeaderType values representing the tracing headers to be used.
-
withServiceName
abstract DatadogTracerBuilder withServiceName(String serviceName)
Sets the service name for the tracer. The service name is a key identifier associated with the traces generated by the tracer, typically representing the application or microservice being traced.
- Parameters:
serviceName- The name of the service to be associated with the tracer.
-
withSampleRate
abstract DatadogTracerBuilder withSampleRate(@FloatRange(from = 0.0.toDouble(), to = 100.0.toDouble()) Double sampleRate)
Sets the sample rate of spans.
- Parameters:
sampleRate- the sample rate as a percentage between 0 and 100 (default is 100%)
-
withPartialFlushMinSpans
abstract DatadogTracerBuilder withPartialFlushMinSpans(Integer partialFlushMinSpans)
Configures the builder to enable partial flushes when the number of spans in a specific trace reaches the given threshold.
- Parameters:
partialFlushMinSpans- The minimum number of spans required to trigger a partial flush.
-
withTag
abstract DatadogTracerBuilder withTag(String key, String value)
Adds a global tag which will be appended to all spans created with the built tracer.
- Parameters:
key- the tag keyvalue- the tag value
-
setBundleWithRumEnabled
abstract DatadogTracerBuilder setBundleWithRumEnabled(Boolean enabled)
Enables the trace bundling with the current active RUM View. If this feature is enabled all the spans from this moment on will be bundled with the current view information and you will be able to see all the traces sent during a specific view in the RUM Explorer.
- Parameters:
enabled- true by default
-
setTraceRateLimit
abstract DatadogTracerBuilder setTraceRateLimit(@IntRange(from = 1.toLong(), to = 2147483647.toLong()) Integer traceRateLimit)
Sets the trace rate limit. This is the maximum number of traces per second that will be accepted. Please note that this property is used in conjunction with the sample rate. If no sample rate is provided this property and its related logic will be ignored.
- Parameters:
traceRateLimit- the trace rate limit as a value between 1 and Int.MAX_VALUE (default is Int.
-
-
-
-