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 |
|
|
Whether to export unsampled spans. |
|
|
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 for configuring the OpenTelemetry integration. If both the OpenTelemetry Environment Variables and the Arconia configuration properties are set, the OpenTelemetry Environment Variables will take precedence.
This support is especially useful during deployment, where you can use the same set of standard environment variables to configure OpenTelemetry Logs across different languages and frameworks.
You can disable this support by setting the arconia.otel.compatibility.environment-variable-specification
configuration property to false
.
Programmatic Configuration
You can further customize the auto-configured SdkTracerProvider
instance via the OpenTelemetryTracerProviderBuilderCustomizer
API.
@FunctionalInterface
public interface OpenTelemetryTracerProviderBuilderCustomizer {
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() {
...
}
}
Exporting Traces
By default, traces are enabled and exported via OTLP, but you can change the type of exporter globally or specifically for traces. If you set the exporter type to none
, the corresponding signal will be disabled from exporting.
If a value is not provided specifically for traces, the value configured for the general exporter is used. |
Property |
Default |
Description |
|
|
The type of OpenTelemetry exporter to use for observability signals. Options: |
|
`` |
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.
The bridge logic is provided by the Micrometer Tracing project, and it’s bundled with the Arconia OpenTelemetry Spring Boot Starter. Disabling the bridge is not a supported configuration option, since Micrometer Tracing is a core part of the OpenTelemetry support in Spring Boot.