@Immutable public abstract class TraceConfig extends Object
Note: To update the TraceConfig associated with a TracerSdkProvider
, you should use the toBuilder()
method on
the TraceConfig currently assigned to the provider, make the changes desired to the TraceConfig.Builder
instance, then use the TracerSdkProvider.updateActiveTraceConfig(TraceConfig)
with the
resulting TraceConfig instance.
Configuration options for TraceConfig
can be read from system properties, environment
variables, or Properties
objects.
For system properties and Properties
objects, TraceConfig
will look
for the following names:
otel.config.sampler.probability
: to set the global default sampler which is used
when constructing a new Span
.
otel.config.max.attrs
: to set the global default max number of attributes per
Span
.
otel.config.max.events
: to set the global default max number of Event
s per
Span
.
otel.config.max.links
: to set the global default max number of Link
entries
per Span
.
otel.config.max.event.attrs
: to set the global default max number of attributes per
Event
.
otel.config.max.link.attrs
: to set the global default max number of attributes per
Link
.
otel.config.max.attr.length
: to set the global default max length of string
attribute value in characters.
For environment variables, TraceConfig
will look for the following names:
OTEL_CONFIG_SAMPLER_PROBABILITY
: to set the global default sampler which is used
when constructing a new Span
.
OTEL_CONFIG_MAX_ATTRS
: to set the global default max number of attributes per
Span
.
OTEL_CONFIG_MAX_EVENTS
: to set the global default max number of Event
s per
Span
.
OTEL_CONFIG_MAX_LINKS
: to set the global default max number of Link
entries
per Span
.
OTEL_CONFIG_MAX_EVENT_ATTRS
: to set the global default max number of attributes per
Event
.
OTEL_CONFIG_MAX_LINK_ATTRS
: to set the global default max number of attributes per
Link
.
OTEL_CONFIG_MAX_ATTR_LENGTH
: to set the global default max length of string
attribute value in characters.
Modifier and Type | Class and Description |
---|---|
static class |
TraceConfig.Builder
Builder for
TraceConfig . |
Modifier and Type | Field and Description |
---|---|
static int |
UNLIMITED_ATTRIBUTE_LENGTH |
Constructor and Description |
---|
TraceConfig() |
Modifier and Type | Method and Description |
---|---|
static TraceConfig |
getDefault()
Returns the default
TraceConfig . |
abstract int |
getMaxLengthOfAttributeValues()
Returns the global default max length of string attribute value in characters.
|
abstract int |
getMaxNumberOfAttributes()
Returns the global default max number of attributes per
Span . |
abstract int |
getMaxNumberOfAttributesPerEvent()
Returns the global default max number of attributes per
Event . |
abstract int |
getMaxNumberOfAttributesPerLink()
Returns the global default max number of attributes per
Link . |
abstract int |
getMaxNumberOfEvents()
Returns the global default max number of
Event s per Span . |
abstract int |
getMaxNumberOfLinks()
Returns the global default max number of
Link entries per Span . |
abstract Sampler |
getSampler()
Returns the global default
Sampler which is used when constructing a new Span . |
boolean |
shouldTruncateStringAttributeValues() |
abstract TraceConfig.Builder |
toBuilder()
Returns a
TraceConfig.Builder initialized to the same property values as the current instance. |
public static final int UNLIMITED_ATTRIBUTE_LENGTH
public static TraceConfig getDefault()
TraceConfig
.TraceConfig
.public abstract Sampler getSampler()
Sampler
which is used when constructing a new Span
.Sampler
.public abstract int getMaxNumberOfAttributes()
Span
.Span
.public abstract int getMaxNumberOfEvents()
Event
s per Span
.Event
s per Span
.public abstract int getMaxNumberOfLinks()
Link
entries per Span
.Link
entries per Span
.public abstract int getMaxNumberOfAttributesPerEvent()
Event
.Event
.public abstract int getMaxNumberOfAttributesPerLink()
Link
.Link
.public abstract int getMaxLengthOfAttributeValues()
shouldTruncateStringAttributeValues()
public boolean shouldTruncateStringAttributeValues()
public abstract TraceConfig.Builder toBuilder()
TraceConfig.Builder
initialized to the same property values as the current instance.TraceConfig.Builder
initialized to the same property values as the current instance.