Class TracingConfig
java.lang.Object
codes.grow.packages.skywalking.tracing.TracingConfig
Immutable tracing setup used by
Tracing.initWith(codes.grow.packages.skywalking.tracing.TracingConfig, codes.grow.packages.skywalking.tracing.SpanExporterFactory).
TracingConfig config = TracingConfig.builder("checkout")
.serviceVersion("1.4.2")
.environment("staging")
.endpoint("http://otel-collector:4318")
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordSpan batch processor settings.static final classBuilder forTracingConfig.static enumExport body compression.static enumExport protocol.static enumSampler (OpenTelemetryOTEL_TRACES_SAMPLERnames). -
Field Summary
FieldsModifier and TypeFieldDescriptionDefault propagators. -
Method Summary
Modifier and TypeMethodDescriptionbatch()Batch processor settings.static TracingConfig.BuilderReturns a builder.Export compression.booleanReturns whethercompression()was set explicitly on the builder (rather than left at the SDK default), so a service package can apply its own default or theOTEL_*environment only when the caller did not choose.endpoint()Export endpoint.deployment.environment.name(and the legacydeployment.environment).headers()Extra export headers (for example authentication).Propagator names.booleanReturns whetherpropagators()was set explicitly on the builder (rather than left at the SDK default), so a service package can apply its own default or theOTEL_*environment only when the caller did not choose.protocol()Export protocol.booleanReturns whetherprotocol()was set explicitly on the builder (rather than left at the SDK default), so a service package can apply its own default or theOTEL_*environment only when the caller did not choose.Extra resource attributes.sampler()Sampler.booleanReturns whethersampler()was set explicitly on the builder (rather than left at the SDK default), so a service package can apply its own default or theOTEL_*environment only when the caller did not choose.doubleRatio of the ratio samplers.booleanReturns whethersamplerRatio()was set explicitly on the builder (rather than left at the SDK default), so a service package can apply its own default or theOTEL_*environment only when the caller did not choose.service.name.service.version.booleanWhetherTracing.initWith(codes.grow.packages.skywalking.tracing.TracingConfig, codes.grow.packages.skywalking.tracing.SpanExporterFactory)registers the SDK as the global OpenTelemetry.tls()TLS settings of the exporter.Returns a builder with these values.toString()Header values are redacted when the header name is sensitive.
-
Field Details
-
DEFAULT_PROPAGATORS
Default propagators.
-
-
Method Details
-
builder
Returns a builder.- Parameters:
serviceName-service.nameof the traced application- Returns:
- builder with the defaults
-
toBuilder
Returns a builder with these values.- Returns:
- builder copy
-
serviceName
service.name.- Returns:
- service name
-
serviceVersion
service.version.- Returns:
- version, if set
-
environment
deployment.environment.name(and the legacydeployment.environment).- Returns:
- environment, if set
-
resourceAttributes
Extra resource attributes.- Returns:
- attributes
-
endpoint
Export endpoint.- Returns:
- endpoint, if set (the service default otherwise)
-
protocol
Export protocol.- Returns:
- protocol
-
headers
Extra export headers (for example authentication).- Returns:
- headers
-
sampler
Sampler.- Returns:
- sampler
-
samplerRatio
public double samplerRatio()Ratio of the ratio samplers.- Returns:
- ratio between 0 and 1
-
propagators
Propagator names.- Returns:
- propagators
-
batch
Batch processor settings.- Returns:
- settings
-
tls
TLS settings of the exporter.- Returns:
- TLS options, if set
-
compression
Export compression.- Returns:
- compression
-
setGlobal
public boolean setGlobal()WhetherTracing.initWith(codes.grow.packages.skywalking.tracing.TracingConfig, codes.grow.packages.skywalking.tracing.SpanExporterFactory)registers the SDK as the global OpenTelemetry.- Returns:
- set-global flag
-
protocolExplicit
public boolean protocolExplicit()Returns whetherprotocol()was set explicitly on the builder (rather than left at the SDK default), so a service package can apply its own default or theOTEL_*environment only when the caller did not choose.- Returns:
- true when the builder setter was called
-
samplerExplicit
public boolean samplerExplicit()Returns whethersampler()was set explicitly on the builder (rather than left at the SDK default), so a service package can apply its own default or theOTEL_*environment only when the caller did not choose.- Returns:
- true when the builder setter was called
-
samplerRatioExplicit
public boolean samplerRatioExplicit()Returns whethersamplerRatio()was set explicitly on the builder (rather than left at the SDK default), so a service package can apply its own default or theOTEL_*environment only when the caller did not choose.- Returns:
- true when the builder setter was called
-
propagatorsExplicit
public boolean propagatorsExplicit()Returns whetherpropagators()was set explicitly on the builder (rather than left at the SDK default), so a service package can apply its own default or theOTEL_*environment only when the caller did not choose.- Returns:
- true when the builder setter was called
-
compressionExplicit
public boolean compressionExplicit()Returns whethercompression()was set explicitly on the builder (rather than left at the SDK default), so a service package can apply its own default or theOTEL_*environment only when the caller did not choose.- Returns:
- true when the builder setter was called
-
toString
Header values are redacted when the header name is sensitive.
-