Class TracingConfigurationOrder
ConfigurationEnhancers and
decorators.
This holder is Internal: it exists to keep the tracing modules' relative ordering in one place and is
expected to be superseded by a framework-wide decorator-order constant holder. Applications ordering their own
decorators relative to tracing should not depend on these values.
- Since:
- 5.3.0
- Author:
- Mateusz Nowak
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intEnhancer orderfor the*SpanAttributesProviderConfigurationEnhancerclasses contributing the built-inSpanAttributesProviderimplementations.static final intDecorator order for allTracing*component wrappers.static final intEnhancer orderfor tracing defaults enhancers -- the ones registering default components viaComponentRegistry.registerIfNotPresent(java.lang.Class<C>, org.axonframework.common.configuration.ComponentBuilder<? extends C>)(the, theinvalid reference
SpanAttributesProviderRegistry*TracingSettingsdefaults). -
Method Summary
-
Field Details
-
TRACING_DECORATOR_ORDER
public static final int TRACING_DECORATOR_ORDERDecorator order for allTracing*component wrappers.Tracing decorators register at near-maximal order so they are applied last and end up as the outermost wrapper of every decorated component. This is a deliberate convention with two effects: (1) tracing spans cover the work of all inner decorators (interception, retries, security), so a span measures what the caller actually experiences; (2) any tracing wrapper is reliably the outermost layer of a registry-built component, so an
instanceof Tracing*check is sufficient to detect an already-traced component (seeTracingStateManager#register). Custom decorators on the same component types should use a lower order unless they deliberately need to observe tracing itself. The same value is used by every*TracingConfigurationEnhancerin the tracing modules.This sits on the opposite end of the scale from AxonFramework's own decorators, which deliberately decorate innermost -- e.g.
org.axonframework.messaging.commandhandling.interception.InterceptingCommandBus#DECORATION_ORDER(Integer.MIN_VALUE + 100). The resulting stack isTracing(...(Intercepting(Simple...))): dispatch and handler spans include interception time, and a message rejected by a dispatch interceptor still produces a span.- See Also:
-
PROVIDER_ENHANCER_ORDER
public static final int PROVIDER_ENHANCER_ORDEREnhancer orderfor the*SpanAttributesProviderConfigurationEnhancerclasses contributing the built-inSpanAttributesProviderimplementations.These run at the default order, before the
defaults enhancers. Correctness does not depend on this: contribution is decorator-based and only applied when theSpanFactoryconsuming the registry is constructed -- after the enhance phase has completed.- See Also:
-
TRACING_DEFAULTS_ENHANCER_ORDER
public static final int TRACING_DEFAULTS_ENHANCER_ORDEREnhancer orderfor tracing defaults enhancers -- the ones registering default components viaComponentRegistry.registerIfNotPresent(java.lang.Class<C>, org.axonframework.common.configuration.ComponentBuilder<? extends C>)(the, theinvalid reference
SpanAttributesProviderRegistry*TracingSettingsdefaults).Runs last, mirroring AxonFramework's
MessagingConfigurationDefaults#ENHANCER_ORDER, so that user-supplied and property-translated registrations (typically contributed at the default order) take precedence over these defaults.- See Also:
-