@Immutable public abstract class TraceConfig extends Object
Note: To update the TraceConfig associated with a TracerSdkManagement, 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 TracerSdkManagement.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 events per Span.
otel.config.max.links: to set the global default max number of links 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 events per Span.
OTEL_CONFIG_MAX_LINKS: to set the global default max number of links 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 events per
Span. |
abstract int |
getMaxNumberOfLinks()
Returns the global default max number of links 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()
Span.Span.public abstract int getMaxNumberOfLinks()
Span.Span.public abstract int getMaxNumberOfAttributesPerEvent()
public abstract int getMaxNumberOfAttributesPerLink()
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.