Class SpanHandler
- java.lang.Object
-
- org.apache.synapse.aspects.flow.statistics.tracing.opentelemetry.management.handling.span.SpanHandler
-
- All Implemented Interfaces:
CallbackEventHandler
,CloseEventHandler
,ContinuationStateStackEventHandler
,OpenEventHandler
,OpenTelemetrySpanHandler
public class SpanHandler extends Object implements OpenTelemetrySpanHandler
Controls Jaeger spans, with respect to various events received during Synapse message flow.
-
-
Constructor Summary
Constructors Constructor Description SpanHandler(TelemetryTracer tracer, io.opentelemetry.api.OpenTelemetry openTelemetry, TracingScopeManager tracingScopeManager)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static io.opentelemetry.context.Context
extract(Map<String,String> tracerSpecificCarrier)
Extract tracer specific information from tracerSpecificCarrier and return the extracted context.void
handleAddCallback(MessageContext messageContext, String callbackId)
Handles callback addition.void
handleCallbackCompletionEvent(MessageContext oldMessageContext, String callbackId)
Handles callback completion.void
handleCloseEntryEvent(BasicStatisticDataUnit basicStatisticDataUnit, MessageContext synCtx)
Handles a close entry event.void
handleCloseFlowForcefully(BasicStatisticDataUnit basicStatisticDataUnit, MessageContext synCtx)
Handles a forceful close event.void
handleOpenChildEntryEvent(StatisticDataUnit statisticDataUnit, MessageContext synCtx)
Handles an open child entry event.void
handleOpenContinuationEvents(BasicStatisticDataUnit statisticDataUnit, MessageContext synCtx)
Handles an open continuation event.void
handleOpenEntryEvent(StatisticDataUnit statisticDataUnit, MessageContext synCtx)
Handles an open entry event.void
handleOpenFlowAggregateEvent(StatisticDataUnit statisticDataUnit, MessageContext synCtx)
Handles a flow aggregate open event.void
handleOpenFlowAsynchronousEvent(BasicStatisticDataUnit statisticDataUnit, MessageContext synCtx)
Handles a flow asynchronous open event.void
handleOpenFlowContinuableEvent(StatisticDataUnit statisticDataUnit, MessageContext synCtx)
Handles a flow continuable open event.void
handleOpenFlowSplittingEvent(StatisticDataUnit statisticDataUnit, MessageContext synCtx)
Handles a flow splitting open event.void
handleReportCallbackHandlingCompletion(MessageContext synapseOutMsgCtx, String callbackId)
Handles callback completion report.void
handleStateStackClearance(MessageContext synCtx)
Handles clearance of the continuation state stack.void
handleStateStackInsertion(MessageContext synCtx, String seqName, SequenceType seqType)
Handles insertion to the continuation state stack.void
handleStateStackRemoval(ContinuationState continuationState, MessageContext synCtx)
Handles removal from the continuation state stack.void
handleTryEndFlow(BasicStatisticDataUnit basicStatisticDataUnit, MessageContext synCtx)
Handles a try end flow event.void
handleUpdateParentsForCallback(MessageContext oldMessageContext, String callbackId)
Handles parents update for a callback.static void
inject(io.opentelemetry.api.trace.Span span, Map<String,String> tracerSpecificCarrier)
Inject tracer specific information to tracerSpecificCarrier.
-
-
-
Constructor Detail
-
SpanHandler
public SpanHandler(TelemetryTracer tracer, io.opentelemetry.api.OpenTelemetry openTelemetry, TracingScopeManager tracingScopeManager)
-
-
Method Detail
-
inject
public static void inject(io.opentelemetry.api.trace.Span span, Map<String,String> tracerSpecificCarrier)
Inject tracer specific information to tracerSpecificCarrier.- Parameters:
span
- Span which the span information will be injected to the tracerSpecificCarrier.tracerSpecificCarrier
- Hashmap to inject the tracer and span context.
-
extract
public static io.opentelemetry.context.Context extract(Map<String,String> tracerSpecificCarrier)
Extract tracer specific information from tracerSpecificCarrier and return the extracted context.- Parameters:
tracerSpecificCarrier
- Hashmap to extract the tracer and span context.- Returns:
- extracted context.
-
handleOpenEntryEvent
public void handleOpenEntryEvent(StatisticDataUnit statisticDataUnit, MessageContext synCtx)
Description copied from interface:OpenEventHandler
Handles an open entry event.- Specified by:
handleOpenEntryEvent
in interfaceOpenEventHandler
- Parameters:
statisticDataUnit
- Statistic data unit object.synCtx
- Message context.
-
handleOpenChildEntryEvent
public void handleOpenChildEntryEvent(StatisticDataUnit statisticDataUnit, MessageContext synCtx)
Description copied from interface:OpenEventHandler
Handles an open child entry event.- Specified by:
handleOpenChildEntryEvent
in interfaceOpenEventHandler
- Parameters:
statisticDataUnit
- Statistic data unit object.synCtx
- Message context.
-
handleOpenFlowContinuableEvent
public void handleOpenFlowContinuableEvent(StatisticDataUnit statisticDataUnit, MessageContext synCtx)
Description copied from interface:OpenEventHandler
Handles a flow continuable open event.- Specified by:
handleOpenFlowContinuableEvent
in interfaceOpenEventHandler
- Parameters:
statisticDataUnit
- Statistic data unit object.synCtx
- Message context.
-
handleOpenFlowSplittingEvent
public void handleOpenFlowSplittingEvent(StatisticDataUnit statisticDataUnit, MessageContext synCtx)
Description copied from interface:OpenEventHandler
Handles a flow splitting open event.- Specified by:
handleOpenFlowSplittingEvent
in interfaceOpenEventHandler
- Parameters:
statisticDataUnit
- Statistic data unit object.synCtx
- Message context.
-
handleOpenFlowAggregateEvent
public void handleOpenFlowAggregateEvent(StatisticDataUnit statisticDataUnit, MessageContext synCtx)
Description copied from interface:OpenEventHandler
Handles a flow aggregate open event.- Specified by:
handleOpenFlowAggregateEvent
in interfaceOpenEventHandler
- Parameters:
statisticDataUnit
- Statistic data unit object.synCtx
- Message context.
-
handleOpenFlowAsynchronousEvent
public void handleOpenFlowAsynchronousEvent(BasicStatisticDataUnit statisticDataUnit, MessageContext synCtx)
Description copied from interface:OpenEventHandler
Handles a flow asynchronous open event.- Specified by:
handleOpenFlowAsynchronousEvent
in interfaceOpenEventHandler
- Parameters:
statisticDataUnit
- Statistic data unit object.synCtx
- Message context.
-
handleOpenContinuationEvents
public void handleOpenContinuationEvents(BasicStatisticDataUnit statisticDataUnit, MessageContext synCtx)
Description copied from interface:OpenEventHandler
Handles an open continuation event.- Specified by:
handleOpenContinuationEvents
in interfaceOpenEventHandler
- Parameters:
statisticDataUnit
- Statistic data unit object.synCtx
- Message context.
-
handleCloseEntryEvent
public void handleCloseEntryEvent(BasicStatisticDataUnit basicStatisticDataUnit, MessageContext synCtx)
Description copied from interface:CloseEventHandler
Handles a close entry event.- Specified by:
handleCloseEntryEvent
in interfaceCloseEventHandler
- Parameters:
basicStatisticDataUnit
- Basic statistic data unit object.synCtx
- Message context.
-
handleCloseFlowForcefully
public void handleCloseFlowForcefully(BasicStatisticDataUnit basicStatisticDataUnit, MessageContext synCtx)
Description copied from interface:CloseEventHandler
Handles a forceful close event.- Specified by:
handleCloseFlowForcefully
in interfaceCloseEventHandler
- Parameters:
basicStatisticDataUnit
- Basic statistic data unit object.synCtx
- Message context.
-
handleTryEndFlow
public void handleTryEndFlow(BasicStatisticDataUnit basicStatisticDataUnit, MessageContext synCtx)
Description copied from interface:CloseEventHandler
Handles a try end flow event.- Specified by:
handleTryEndFlow
in interfaceCloseEventHandler
- Parameters:
basicStatisticDataUnit
- Basic statistic data unit object.synCtx
- Message context.
-
handleAddCallback
public void handleAddCallback(MessageContext messageContext, String callbackId)
Description copied from interface:CallbackEventHandler
Handles callback addition.- Specified by:
handleAddCallback
in interfaceCallbackEventHandler
- Parameters:
messageContext
- Message context.callbackId
- Callback id.
-
handleCallbackCompletionEvent
public void handleCallbackCompletionEvent(MessageContext oldMessageContext, String callbackId)
Description copied from interface:CallbackEventHandler
Handles callback completion.- Specified by:
handleCallbackCompletionEvent
in interfaceCallbackEventHandler
- Parameters:
oldMessageContext
- Old message context.callbackId
- Callback id.
-
handleUpdateParentsForCallback
public void handleUpdateParentsForCallback(MessageContext oldMessageContext, String callbackId)
Description copied from interface:CallbackEventHandler
Handles parents update for a callback.- Specified by:
handleUpdateParentsForCallback
in interfaceCallbackEventHandler
- Parameters:
oldMessageContext
- Old message context.callbackId
- Callback id.
-
handleReportCallbackHandlingCompletion
public void handleReportCallbackHandlingCompletion(MessageContext synapseOutMsgCtx, String callbackId)
Description copied from interface:CallbackEventHandler
Handles callback completion report.- Specified by:
handleReportCallbackHandlingCompletion
in interfaceCallbackEventHandler
- Parameters:
synapseOutMsgCtx
- Synapse out message context.callbackId
- Callback id.
-
handleStateStackInsertion
public void handleStateStackInsertion(MessageContext synCtx, String seqName, SequenceType seqType)
Description copied from interface:ContinuationStateStackEventHandler
Handles insertion to the continuation state stack.- Specified by:
handleStateStackInsertion
in interfaceContinuationStateStackEventHandler
- Parameters:
synCtx
- Message context.seqName
- Sequence name.seqType
- Sequence type.
-
handleStateStackRemoval
public void handleStateStackRemoval(ContinuationState continuationState, MessageContext synCtx)
Description copied from interface:ContinuationStateStackEventHandler
Handles removal from the continuation state stack.- Specified by:
handleStateStackRemoval
in interfaceContinuationStateStackEventHandler
- Parameters:
continuationState
- Continuation state.synCtx
- Message context.
-
handleStateStackClearance
public void handleStateStackClearance(MessageContext synCtx)
Description copied from interface:ContinuationStateStackEventHandler
Handles clearance of the continuation state stack.- Specified by:
handleStateStackClearance
in interfaceContinuationStateStackEventHandler
- Parameters:
synCtx
- Message context.
-
-