Class MicrometerTracingAutoConfiguration
java.lang.Object
io.axoniq.framework.springboot.autoconfig.MicrometerTracingAutoConfiguration
@AutoConfiguration(afterName="org.springframework.boot.actuate.autoconfigure.tracing.MicrometerTracingAutoConfiguration")
@ConditionalOnClass({io.micrometer.tracing.Tracer.class,MicrometerSpanFactory.class})
@EnableConfigurationProperties(ThreadLocalContextPropagationProperties.class)
public class MicrometerTracingAutoConfiguration
extends Object
Autoconfiguration that toggles the Micrometer tracing binding when the
axoniq-tracing-micrometer module is on
the classpath. The binding itself self-wires via ServiceLoader: MicrometerTracingConfigurationEnhancer
registers the SpanFactory from the Tracer/Propagator
beans (bridged to Axon components by the Spring configurer), and
MicrometerThreadLocalContextPropagationConfigurationEnhancer installs the thread-local bridge. This
autoconfiguration therefore contributes no wiring beans -- only property-driven toggles:
micrometerTracingDisablingEnhancer()disables both enhancers whenaxon.tracing.enabled=false, so noSpanFactoryis registered and nothing is decorated;threadLocalContextPropagationTogglingEnhancer(ThreadLocalContextPropagationProperties)disables only the thread-local bridge whenaxon.tracing.thread-local-context-propagation.enabled=false, leaving core tracing (spans + cross-service propagation) on.
Tracer, Propagator and ObservationRegistry beans come from Spring Boot's own tracing
auto-configuration (Boot 3.5 / 4.0 spring-boot-starter-actuator + a bridge such as
micrometer-tracing-bridge-otel).- Since:
- 5.3.0
- Author:
- Mateusz Nowak
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDisables the Micrometer tracing enhancers whenaxon.tracing.enabled=false, so that even with the module (and aTracerbean) on the classpath noSpanFactoryis registered and every component stays undecorated.Disables theMicrometerThreadLocalContextPropagationConfigurationEnhancer-- and with it theUnitOfWorkFactorydecorator and thread-local span accessor that make the active Axon span current on the framework's worker threads -- whenaxon.tracing.thread-local-context-propagation.enabledisfalse.
-
Constructor Details
-
MicrometerTracingAutoConfiguration
public MicrometerTracingAutoConfiguration()
-
-
Method Details
-
micrometerTracingDisablingEnhancer
@Bean @ConditionalOnProperty(prefix="axon.tracing", name="enabled", havingValue="false") public ConfigurationEnhancer micrometerTracingDisablingEnhancer()Disables the Micrometer tracing enhancers whenaxon.tracing.enabled=false, so that even with the module (and aTracerbean) on the classpath noSpanFactoryis registered and every component stays undecorated.- Returns:
- a
ConfigurationEnhancerthat disables both Micrometer tracing enhancers
-
threadLocalContextPropagationTogglingEnhancer
@Bean public ConfigurationEnhancer threadLocalContextPropagationTogglingEnhancer(ThreadLocalContextPropagationProperties properties) Disables theMicrometerThreadLocalContextPropagationConfigurationEnhancer-- and with it theUnitOfWorkFactorydecorator and thread-local span accessor that make the active Axon span current on the framework's worker threads -- whenaxon.tracing.thread-local-context-propagation.enabledisfalse. Core tracing (spans and cross-service propagation) is unaffected. When the property istrue(the default) this enhancer does nothing and the ServiceLoader-discovered enhancer installs the bridge as usual.- Parameters:
properties- the boundThreadLocalContextPropagationProperties- Returns:
- a
ConfigurationEnhancerthat disables the thread-local bridge when it is switched off
-