Class DefaultEventProcessorSpanFactory
java.lang.Object
org.axonframework.messaging.eventhandling.tracing.DefaultEventProcessorSpanFactory
- All Implemented Interfaces:
EventProcessorSpanFactory
Default implementation of the
EventProcessorSpanFactory.
Creates a root trace for each batch of events and a linked handler span for each event in the batch by default. This
behavior can be changed by setting DefaultEventProcessorSpanFactory.Builder.disableBatchTrace(boolean) to true.
If you prefer to have asynchronously handled events in the same trace as the trace that published it, you can set
DefaultEventProcessorSpanFactory.Builder.distributedInSameTrace(boolean) to true. If true, this duration defaults to 2
minutes, which you can adjust using DefaultEventProcessorSpanFactory.Builder.distributedInSameTraceTimeLimit(Duration).
- Since:
- 4.9.0
- Author:
- Mitchell Herrijgers
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class to instantiate aDefaultEventProcessorSpanFactory. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a newDefaultEventProcessorSpanFactoryusing the providedbuilder. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a newDefaultEventProcessorSpanFactory.Builderto build aDefaultEventProcessorSpanFactorywith.createBatchSpan(boolean streaming, List<? extends EventMessage> eventMessages) Creates a span for the batch of events that are handled by the event processor.createProcessEventSpan(boolean streaming, EventMessage eventMessage) Creates a span for the handling of an event.
-
Constructor Details
-
DefaultEventProcessorSpanFactory
Creates a newDefaultEventProcessorSpanFactoryusing the providedbuilder.- Parameters:
builder- The builder to build theDefaultEventProcessorSpanFactoryfrom.
-
-
Method Details
-
builder
Creates a newDefaultEventProcessorSpanFactory.Builderto build aDefaultEventProcessorSpanFactorywith. The default values are:disableBatchTracedefaults tofalsedistributedInSameTracedefaults tofalsedistributedInSameTraceTimeLimitdefaults to 2 minutes
spanFactoryis a required field and should be provided.- Returns:
- The
DefaultEventProcessorSpanFactory.Builderto build aDefaultEventProcessorSpanFactorywith.
-
createBatchSpan
Description copied from interface:EventProcessorSpanFactoryCreates a span for the batch of events that are handled by the event processor.- Specified by:
createBatchSpanin interfaceEventProcessorSpanFactory- Parameters:
streaming- Whether the event is handled by aStreamingEventProcessor.eventMessages- The event messages that are in the batch.- Returns:
- The created span.
-
createProcessEventSpan
Description copied from interface:EventProcessorSpanFactoryCreates a span for the handling of an event. This entails the entire interceptor chain and the handler.- Specified by:
createProcessEventSpanin interfaceEventProcessorSpanFactory- Parameters:
streaming- Whether the event is handled by aStreamingEventProcessor.eventMessage- The event message that is handled.- Returns:
- The created span.
-