Class TracingConfig.Builder
java.lang.Object
codes.grow.packages.tempo.tracing.TracingConfig.Builder
- Enclosing class:
TracingConfig
Builder for
TracingConfig.-
Method Summary
Modifier and TypeMethodDescriptionbatch(TracingConfig.BatchSettings batch) Sets the batch processor settings.build()Validates and builds.compression(TracingConfig.Compression compression) Sets the export compression.Sets the export endpoint.environment(String environment) Setsdeployment.environment.nameand the legacydeployment.environment.Adds an export header.Replaces the export headers.propagators(List<String> propagators) Sets the propagators (tracecontext,baggage,b3,b3multi,noneor names the service package registers).protocol(TracingConfig.Protocol protocol) Sets the export protocol (defaulthttp/protobufunless the service changes it).resourceAttributes(Map<String, ?> attributes) Replaces the extra resource attributes.sampler(TracingConfig.SamplerType sampler) Sets the sampler.samplerRatio(double samplerRatio) Sets the ratio of the ratio samplers.serviceName(String serviceName) Setsservice.name.serviceVersion(String serviceVersion) Setsservice.version.setGlobal(boolean setGlobal) Whether to register the SDK globally (default true).tls(TlsOptions tls) Sets the exporter TLS options.
-
Method Details
-
serviceName
Setsservice.name.- Parameters:
serviceName- non-blank name- Returns:
- this builder
-
serviceVersion
Setsservice.version.- Parameters:
serviceVersion- version ornull- Returns:
- this builder
-
environment
Setsdeployment.environment.nameand the legacydeployment.environment.- Parameters:
environment- environment ornull- Returns:
- this builder
-
resourceAttributes
Replaces the extra resource attributes.- Parameters:
attributes- attributes- Returns:
- this builder
-
endpoint
Sets the export endpoint.- Parameters:
endpoint- http(s) URL ornullfor the service default- Returns:
- this builder
-
protocol
Sets the export protocol (defaulthttp/protobufunless the service changes it).- Parameters:
protocol- protocol- Returns:
- this builder
-
headers
Replaces the export headers.- Parameters:
headers- headers- Returns:
- this builder
-
header
Adds an export header.- Parameters:
name- header namevalue- header value- Returns:
- this builder
-
sampler
Sets the sampler.- Parameters:
sampler- sampler- Returns:
- this builder
-
samplerRatio
Sets the ratio of the ratio samplers.- Parameters:
samplerRatio- between 0 and 1- Returns:
- this builder
-
propagators
Sets the propagators (tracecontext,baggage,b3,b3multi,noneor names the service package registers).- Parameters:
propagators- names- Returns:
- this builder
-
batch
Sets the batch processor settings.- Parameters:
batch- settings- Returns:
- this builder
-
tls
Sets the exporter TLS options.- Parameters:
tls- options ornull- Returns:
- this builder
-
compression
Sets the export compression.- Parameters:
compression- compression- Returns:
- this builder
-
setGlobal
Whether to register the SDK globally (default true).- Parameters:
setGlobal- flag- Returns:
- this builder
-
build
Validates and builds.- Returns:
- config
- Throws:
ConfigException- when a value is invalid
-