OpenTelemetry Traces
Enabling/Disabling Traces
Support for OpenTelemetry Traces is enabled by default. You can disable it via configuration properties.
arconia:
otel:
traces:
enabled: false
Configuration Properties
You can configure the support for OpenTelemetry Traces via configuration properties.
Sampling
How to sample traces.
|
|
How to sample traces. Options: |
|
|
The probability ratio for sampling a span. Used when the sampling strategy is |
Propagation
Arconia OpenTelemetry relies on Spring Boot Actuator for configuring propagation, based on Micrometer Tracing. For convenience, the configuration properties from Spring Boot Actuator are included here.
For more information, refer to the Micrometer Tracing and Spring Boot Actuator documentation. |
|
`` |
Tracing context propagation types produced and consumed by the application. Setting this property overrides the more fine-grained propagation type properties. |
|
|
Tracing context propagation types produced by the application. |
|
|
Tracing context propagation types consumed by the application. |
Baggage
Arconia OpenTelemetry relies on Spring Boot Actuator for configuring baggage management, based on Micrometer Tracing. For convenience, the configuration properties from Spring Boot Actuator are included here.
For more information, refer to the Micrometer Tracing and Spring Boot Actuator documentation. |
|
|
Whether to enable Micrometer Tracing baggage propagation. |
|
|
Whether to enable correlation of the baggage context with logging contexts. |
|
|
List of fields that should be correlated with the logging context. That means that these fields would end up as key-value pairs in e.g. MDC. |
|
`` |
List of fields that are referenced the same in-process as it is on the wire. For example, the field "x-vcap-request-id" would be set as-is including the prefix. |
|
`` |
List of fields that should automatically become tags. |
Span Limits
Constraints for the data captured by spans.
Property |
Default |
Description |
|
- |
Maximum length of each attribute value. |
|
|
Maximum number of attributes per span. |
|
|
Maximum number of attributes per event. |
|
|
Maximum number of attributes per link. |
|
|
Maximum number of events per span. |
|
|
Maximum number of links per span. |
Span Processor
Configuration for the batch span processor.
Property |
Default |
Description |
|
|
The maximum allowed time to export spans. |
|
|
The maximum number of spans to export in a single batch. |
|
|
The maximum number of spans that can be queued before batching. |
|
|
Whether to generate metrics for the span processor. |
|
|
The interval between two consecutive exports. |
OpenTelemetry Environment Variables
Arconia supports the OpenTelemetry Environment Variable Specification, so you can configure the support for OpenTelemetry Traces using environment variables as well.
This support is especially useful during deployment, where you can use the same set of standard environment variables to configure OpenTelemetry Traces across different languages and frameworks.
OpenTelemetry Java System Properties
Arconia supports the OpenTelemetry Java System Properties in alignment with the OpenTelemetry Java SDK Autoconfigure module. So you can configure the support for OpenTelemetry Traces using system properties as well.
This support is especially useful if you’re migrating from the OpenTelemetry-own Spring Boot Starter to Arconia OpenTelemetry, and you want to minimize the changes in your configuration. Check our migration guide for more information.
When possible, we recommend using the Arconia-specific properties instead of the OpenTelemetry Java system properties since they offer a more consistent configuration experience familiar to Spring Boot users.
Programmatic Configuration
You can further customize the auto-configured SdkTracerProvider
instance via the SdkTracerProviderBuilderCustomizer
API.
@FunctionalInterface
public interface SdkTracerProviderBuilderCustomizer {
void customize(SdkTracerProviderBuilder builder);
}
Disabling the Auto-Configuration
The auto-configuration provided by Arconia for OpenTelemetry Traces is enabled by default, but you can disable it as explained in the Enabling/Disabling Traces section.
If you define a custom SdkTracerProvider
bean, the auto-configuration will back off, and your custom bean will be used instead.
@Configuration(proxyBeanMethods = false)
public class MyTracingConfiguration {
@Bean
public SdkTracerProvider myTracerProvider() {
...
}
}
You can also disable the auto-configuration entirely by excluding the io.arconia.opentelemetry.autoconfigure.sdk.traces.OpenTelemetryTracingAutoConfiguration
class from the Spring Boot auto-configuration:
spring:
autoconfigure:
exclude:
- io.arconia.opentelemetry.autoconfigure.sdk.traces.OpenTelemetryTracingAutoConfiguration
Exporting Traces
By default, traces are enabled and exported via OTLP, but you can change the type of exporter. If you set the exporter type to none
, the corresponding signal will be disabled from exporting.
Property |
Default |
Description |
|
|
The type of OpenTelemetry exporter to use for traces. Options: |
For more information on exporting traces to the console, refer to Console Exporter. |
OTLP
When traces are exported via OTLP (default behavior), you can configure the following properties.
If a value is not provided specifically for traces, the value configured for the general OTLP export is used, if available. See OTLP. |
Property |
Default |
Description |
|
|
Compression type to use for OTLP requests. Options: |
|
|
The maximum waiting time for the exporter to establish a connection to the endpoint. |
|
|
The endpoint to which telemetry data will be sent. |
|
- |
Additional headers to include in each request to the endpoint. |
|
|
Whether to generate metrics for the exporter itself. |
|
|
Transport protocol to use for OTLP requests. Options: |
|
|
The maximum waiting time for the exporter to send each telemetry batch. |
The default OTLP exporter uses HTTP/Protobuf. If you’d like to use gRPC, refer to OTLP gRPC. |
Micrometer Tracing Bridge
Spring libraries and other libraries from the Java ecosystem are instrumented using Micrometer Tracing (via the Micrometer Observation
API) and rely on Micrometer for context propagation and baggage management. The Arconia OpenTelemetry Spring Boot Starter provides a bridge that allows you to convert Micrometer traces into OpenTelemetry Traces and export them via OTLP.
Enabling/Disabling the Bridge
The bridge logic is provided by the Micrometer Tracing project, and it’s bundled with the Arconia OpenTelemetry Spring Boot Starter.
If you want to disable the bridge, you’ll need to exclude the dependency from the starter.
dependencies {
implementation("io.arconia:arconia-opentelemetry-spring-boot-starter") {
exclude group: 'io.micrometer', module: 'micrometer-tracing-bridge-otel'
}
}