@ParametersAreNonnullByDefault

Package io.opentelemetry.sdk.trace.config

Classes that holds global trace parameters

Contents

Default values for TraceConfig

  • SAMPLER: Samplers.alwaysOn()
  • SPAN_MAX_NUM_ATTRIBUTES: 32
  • SPAN_MAX_NUM_EVENTS: 128
  • SPAN_MAX_NUM_LINKS: 32
  • SPAN_MAX_NUM_ATTRIBUTES_PER_EVENT: 32
  • SPAN_MAX_NUM_ATTRIBUTES_PER_LINK: 32

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.span.attribute.count.limit: to set the global default max number of attributes per Span.
  • otel.span.event.count.limit: to set the global default max number of events per Span.
  • otel.span.link.count.limit: 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.

For environment variable, 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_SPAN_ATTRIBUTE_COUNT_LIMIT: to set the global default max number of attributes per Span.
  • OTEL_SPAN_EVENT_COUNT_LIMIT: to set the global default max number of events per Span.
  • OTEL_SPAN_LINK_COUNT_LIMIT: to set the global default max number of links 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.