Class TracingAutoConfiguration

java.lang.Object
org.axonframework.extension.springboot.autoconfig.TracingAutoConfiguration

@AutoConfiguration @ConditionalOnClass(SpanFactory.class) @ConditionalOnProperty(prefix="axon.tracing", name="enabled", havingValue="true", matchIfMissing=true) @EnableConfigurationProperties(TracingProperties.class) public class TracingAutoConfiguration extends Object
Autoconfiguration translating the axon.tracing.* properties into the framework's native tracing configuration.

This layer is deliberately thin: it registers the *TracingSettings components derived from TracingProperties (via registerIfNotPresent, so a user-defined settings bean or component always wins). Everything else - the built-in attribute providers, their toggles, and the tracing decorators - is wired natively by the ServiceLoader-discovered enhancers of the framework modules, driven by these settings.

The SpanFactory is optional and contributed by a tracing backend (for example an OpenTelemetry-backed SpanFactory registered by its own autoconfiguration). When no factory component is present, component decorators are not installed. The whole configuration backs off when axon.tracing.enabled is set to false, in which case no settings are registered.

Since:
4.6.0
Author:
Mateusz Nowak, Mitchell Herrijgers
  • Constructor Details

    • TracingAutoConfiguration

      public TracingAutoConfiguration()
  • Method Details

    • tracingConfigurationEnhancer

      @Bean public ConfigurationEnhancer tracingConfigurationEnhancer(org.springframework.beans.factory.ObjectProvider<SpanAttributesProvider> customProviders, TracingProperties properties)
      Constructs a ConfigurationEnhancer translating the axon.tracing.* properties into the tracing settings components.

      Settings are registered with registerIfNotPresent: a user-defined settings bean (or an explicitly registered component) takes precedence over the property translation, which in turn takes precedence over the framework modules' native enabledByDefault() defaults (registered by enhancers running at maximal order).

      Parameters:
      customProviders - the Spring-managed SpanAttributesProvider instances available to tracing
      properties - the bound TracingProperties
      Returns:
      a ConfigurationEnhancer registering the tracing settings with the framework