-
public final class OtelTracerProvider.BuilderA builder for creating TracerProvider instances.
-
-
Constructor Summary
Constructors Constructor Description OtelTracerProvider.Builder(SdkCore sdkCore)OtelTracerProvider.Builder()
-
Method Summary
Modifier and Type Method Description final TracerProviderbuild()Builds a TracerProvider based on the current state of this Builder. final OtelTracerProvider.BuildersetTracingHeaderTypes(Set<TracingHeaderType> headerTypes)Sets the tracing header styles that may be injected by this tracer. final OtelTracerProvider.BuildersetService(String service)Sets the service name that will appear in your traces. final OtelTracerProvider.BuildersetPartialFlushThreshold(Integer threshold)Sets the partial flush threshold. final OtelTracerProvider.BuilderaddTag(String key, String value)Adds a global tag which will be appended to all spans created with the built tracer. final OtelTracerProvider.BuildersetSampleRate(@FloatRange(from = 0.0.toDouble(), to = 100.0.toDouble()) Double sampleRate)Sets the sample rate of spans. final OtelTracerProvider.BuildersetTraceRateLimit(@IntRange(from = 1.toLong(), to = 2147483647.toLong()) Integer traceRateLimit)Sets the trace rate limit. final OtelTracerProvider.BuildersetBundleWithRumEnabled(Boolean enabled)Enables the trace bundling with the current active View. -
-
Method Detail
-
build
final TracerProvider build()
Builds a TracerProvider based on the current state of this Builder.
-
setTracingHeaderTypes
final OtelTracerProvider.Builder setTracingHeaderTypes(Set<TracingHeaderType> headerTypes)
Sets the tracing header styles that may be injected by this tracer.
- Parameters:
headerTypes- the list of header types injected (default = datadog style headers)
-
setService
final OtelTracerProvider.Builder setService(String service)
Sets the service name that will appear in your traces.
- Parameters:
service- the service name (default = application package name)
-
setPartialFlushThreshold
final OtelTracerProvider.Builder setPartialFlushThreshold(Integer threshold)
Sets the partial flush threshold. When this threshold is reached (you have a specific amount of spans closed waiting) the flush mechanism will be triggered and all the pending closed spans will be processed in order to be sent to the intake.
- Parameters:
threshold- the threshold value (default = 5)
-
addTag
final OtelTracerProvider.Builder addTag(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
-
setSampleRate
final OtelTracerProvider.Builder setSampleRate(@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%)
-
setTraceRateLimit
final OtelTracerProvider.Builder 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 not 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.
-
setBundleWithRumEnabled
final OtelTracerProvider.Builder setBundleWithRumEnabled(Boolean enabled)
Enables the trace bundling with the current active 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
-
-
-
-