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.Contextextract(Map<String,String> tracerSpecificCarrier)Extract tracer specific information from tracerSpecificCarrier and return the extracted context.voidhandleAddCallback(MessageContext messageContext, String callbackId)Handles callback addition.voidhandleCallbackCompletionEvent(MessageContext oldMessageContext, String callbackId)Handles callback completion.voidhandleCloseEntryEvent(BasicStatisticDataUnit basicStatisticDataUnit, MessageContext synCtx)Handles a close entry event.voidhandleCloseFlowForcefully(BasicStatisticDataUnit basicStatisticDataUnit, MessageContext synCtx)Handles a forceful close event.voidhandleOpenChildEntryEvent(StatisticDataUnit statisticDataUnit, MessageContext synCtx)Handles an open child entry event.voidhandleOpenContinuationEvents(BasicStatisticDataUnit statisticDataUnit, MessageContext synCtx)Handles an open continuation event.voidhandleOpenEntryEvent(StatisticDataUnit statisticDataUnit, MessageContext synCtx)Handles an open entry event.voidhandleOpenFlowAggregateEvent(StatisticDataUnit statisticDataUnit, MessageContext synCtx)Handles a flow aggregate open event.voidhandleOpenFlowAsynchronousEvent(BasicStatisticDataUnit statisticDataUnit, MessageContext synCtx)Handles a flow asynchronous open event.voidhandleOpenFlowContinuableEvent(StatisticDataUnit statisticDataUnit, MessageContext synCtx)Handles a flow continuable open event.voidhandleOpenFlowSplittingEvent(StatisticDataUnit statisticDataUnit, MessageContext synCtx)Handles a flow splitting open event.voidhandleReportCallbackHandlingCompletion(MessageContext synapseOutMsgCtx, String callbackId)Handles callback completion report.voidhandleStateStackClearance(MessageContext synCtx)Handles clearance of the continuation state stack.voidhandleStateStackInsertion(MessageContext synCtx, String seqName, SequenceType seqType)Handles insertion to the continuation state stack.voidhandleStateStackRemoval(ContinuationState continuationState, MessageContext synCtx)Handles removal from the continuation state stack.voidhandleTryEndFlow(BasicStatisticDataUnit basicStatisticDataUnit, MessageContext synCtx)Handles a try end flow event.voidhandleUpdateParentsForCallback(MessageContext oldMessageContext, String callbackId)Handles parents update for a callback.static voidinject(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:OpenEventHandlerHandles an open entry event.- Specified by:
handleOpenEntryEventin interfaceOpenEventHandler- Parameters:
statisticDataUnit- Statistic data unit object.synCtx- Message context.
-
handleOpenChildEntryEvent
public void handleOpenChildEntryEvent(StatisticDataUnit statisticDataUnit, MessageContext synCtx)
Description copied from interface:OpenEventHandlerHandles an open child entry event.- Specified by:
handleOpenChildEntryEventin interfaceOpenEventHandler- Parameters:
statisticDataUnit- Statistic data unit object.synCtx- Message context.
-
handleOpenFlowContinuableEvent
public void handleOpenFlowContinuableEvent(StatisticDataUnit statisticDataUnit, MessageContext synCtx)
Description copied from interface:OpenEventHandlerHandles a flow continuable open event.- Specified by:
handleOpenFlowContinuableEventin interfaceOpenEventHandler- Parameters:
statisticDataUnit- Statistic data unit object.synCtx- Message context.
-
handleOpenFlowSplittingEvent
public void handleOpenFlowSplittingEvent(StatisticDataUnit statisticDataUnit, MessageContext synCtx)
Description copied from interface:OpenEventHandlerHandles a flow splitting open event.- Specified by:
handleOpenFlowSplittingEventin interfaceOpenEventHandler- Parameters:
statisticDataUnit- Statistic data unit object.synCtx- Message context.
-
handleOpenFlowAggregateEvent
public void handleOpenFlowAggregateEvent(StatisticDataUnit statisticDataUnit, MessageContext synCtx)
Description copied from interface:OpenEventHandlerHandles a flow aggregate open event.- Specified by:
handleOpenFlowAggregateEventin interfaceOpenEventHandler- Parameters:
statisticDataUnit- Statistic data unit object.synCtx- Message context.
-
handleOpenFlowAsynchronousEvent
public void handleOpenFlowAsynchronousEvent(BasicStatisticDataUnit statisticDataUnit, MessageContext synCtx)
Description copied from interface:OpenEventHandlerHandles a flow asynchronous open event.- Specified by:
handleOpenFlowAsynchronousEventin interfaceOpenEventHandler- Parameters:
statisticDataUnit- Statistic data unit object.synCtx- Message context.
-
handleOpenContinuationEvents
public void handleOpenContinuationEvents(BasicStatisticDataUnit statisticDataUnit, MessageContext synCtx)
Description copied from interface:OpenEventHandlerHandles an open continuation event.- Specified by:
handleOpenContinuationEventsin interfaceOpenEventHandler- Parameters:
statisticDataUnit- Statistic data unit object.synCtx- Message context.
-
handleCloseEntryEvent
public void handleCloseEntryEvent(BasicStatisticDataUnit basicStatisticDataUnit, MessageContext synCtx)
Description copied from interface:CloseEventHandlerHandles a close entry event.- Specified by:
handleCloseEntryEventin interfaceCloseEventHandler- Parameters:
basicStatisticDataUnit- Basic statistic data unit object.synCtx- Message context.
-
handleCloseFlowForcefully
public void handleCloseFlowForcefully(BasicStatisticDataUnit basicStatisticDataUnit, MessageContext synCtx)
Description copied from interface:CloseEventHandlerHandles a forceful close event.- Specified by:
handleCloseFlowForcefullyin interfaceCloseEventHandler- Parameters:
basicStatisticDataUnit- Basic statistic data unit object.synCtx- Message context.
-
handleTryEndFlow
public void handleTryEndFlow(BasicStatisticDataUnit basicStatisticDataUnit, MessageContext synCtx)
Description copied from interface:CloseEventHandlerHandles a try end flow event.- Specified by:
handleTryEndFlowin interfaceCloseEventHandler- Parameters:
basicStatisticDataUnit- Basic statistic data unit object.synCtx- Message context.
-
handleAddCallback
public void handleAddCallback(MessageContext messageContext, String callbackId)
Description copied from interface:CallbackEventHandlerHandles callback addition.- Specified by:
handleAddCallbackin interfaceCallbackEventHandler- Parameters:
messageContext- Message context.callbackId- Callback id.
-
handleCallbackCompletionEvent
public void handleCallbackCompletionEvent(MessageContext oldMessageContext, String callbackId)
Description copied from interface:CallbackEventHandlerHandles callback completion.- Specified by:
handleCallbackCompletionEventin interfaceCallbackEventHandler- Parameters:
oldMessageContext- Old message context.callbackId- Callback id.
-
handleUpdateParentsForCallback
public void handleUpdateParentsForCallback(MessageContext oldMessageContext, String callbackId)
Description copied from interface:CallbackEventHandlerHandles parents update for a callback.- Specified by:
handleUpdateParentsForCallbackin interfaceCallbackEventHandler- Parameters:
oldMessageContext- Old message context.callbackId- Callback id.
-
handleReportCallbackHandlingCompletion
public void handleReportCallbackHandlingCompletion(MessageContext synapseOutMsgCtx, String callbackId)
Description copied from interface:CallbackEventHandlerHandles callback completion report.- Specified by:
handleReportCallbackHandlingCompletionin interfaceCallbackEventHandler- Parameters:
synapseOutMsgCtx- Synapse out message context.callbackId- Callback id.
-
handleStateStackInsertion
public void handleStateStackInsertion(MessageContext synCtx, String seqName, SequenceType seqType)
Description copied from interface:ContinuationStateStackEventHandlerHandles insertion to the continuation state stack.- Specified by:
handleStateStackInsertionin interfaceContinuationStateStackEventHandler- Parameters:
synCtx- Message context.seqName- Sequence name.seqType- Sequence type.
-
handleStateStackRemoval
public void handleStateStackRemoval(ContinuationState continuationState, MessageContext synCtx)
Description copied from interface:ContinuationStateStackEventHandlerHandles removal from the continuation state stack.- Specified by:
handleStateStackRemovalin interfaceContinuationStateStackEventHandler- Parameters:
continuationState- Continuation state.synCtx- Message context.
-
handleStateStackClearance
public void handleStateStackClearance(MessageContext synCtx)
Description copied from interface:ContinuationStateStackEventHandlerHandles clearance of the continuation state stack.- Specified by:
handleStateStackClearancein interfaceContinuationStateStackEventHandler- Parameters:
synCtx- Message context.
-
-