public class DefaultEventProcessorSpanFactory extends Object implements EventProcessorSpanFactory
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)
.
Modifier and Type | Class and Description |
---|---|
static class |
DefaultEventProcessorSpanFactory.Builder
Builder class to instantiate a
DefaultEventProcessorSpanFactory . |
Modifier | Constructor and Description |
---|---|
protected |
DefaultEventProcessorSpanFactory(DefaultEventProcessorSpanFactory.Builder builder)
Creates a new
DefaultEventProcessorSpanFactory using the provided builder . |
Modifier and Type | Method and Description |
---|---|
static DefaultEventProcessorSpanFactory.Builder |
builder()
Creates a new
DefaultEventProcessorSpanFactory.Builder to build a DefaultEventProcessorSpanFactory with. |
Span |
createBatchSpan(boolean streaming,
List<? extends EventMessage<?>> eventMessages)
Creates a span for the batch of events that are handled by the event processor.
|
Span |
createProcessEventSpan(boolean streaming,
EventMessage<?> eventMessage)
Creates a span for the handling of an event.
|
protected DefaultEventProcessorSpanFactory(DefaultEventProcessorSpanFactory.Builder builder)
DefaultEventProcessorSpanFactory
using the provided builder
.builder
- The builder to build the DefaultEventProcessorSpanFactory
from.public static DefaultEventProcessorSpanFactory.Builder builder()
DefaultEventProcessorSpanFactory.Builder
to build a DefaultEventProcessorSpanFactory
with. The default values are:
disableBatchTrace
defaults to false
distributedInSameTrace
defaults to false
distributedInSameTraceTimeLimit
defaults to 2 minutesspanFactory
is a required field and should be provided.DefaultEventProcessorSpanFactory.Builder
to build a DefaultEventProcessorSpanFactory
with.public Span createBatchSpan(boolean streaming, List<? extends EventMessage<?>> eventMessages)
EventProcessorSpanFactory
createBatchSpan
in interface EventProcessorSpanFactory
streaming
- Whether the event is handled by a StreamingEventProcessor
.eventMessages
- The event messages that are in the batch.public Span createProcessEventSpan(boolean streaming, EventMessage<?> eventMessage)
EventProcessorSpanFactory
createProcessEventSpan
in interface EventProcessorSpanFactory
streaming
- Whether the event is handled by a StreamingEventProcessor
.eventMessage
- The event message that is handled.Copyright © 2010–2024. All rights reserved.