Interface AsyncSpanEndStrategy


  • public interface AsyncSpanEndStrategy
    Represents an implementation of a strategy for composing over the return value of an asynchronous traced method which can compose or register for notification of completion at which point the span representing the invocation of the method will be ended.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Object end​(BaseTracer tracer, io.opentelemetry.context.Context context, Object returnValue)
      Denotes the end of the invocation of the traced method with a successful result which will end the span stored in the passed context.
      boolean supports​(Class<?> returnType)  
    • Method Detail

      • supports

        boolean supports​(Class<?> returnType)
      • end

        Object end​(BaseTracer tracer,
                   io.opentelemetry.context.Context context,
                   Object returnValue)
        Denotes the end of the invocation of the traced method with a successful result which will end the span stored in the passed context. The span will remain open until the asynchronous operation has completed.
        Parameters:
        tracer - BaseTracer tracer to be used to end the span stored in the context.
        returnValue - Return value from the traced method. Must be an instance of a returnType for which supports(Class) returned true (in particular it must not be null).
        Returns:
        Either returnValue or a value composing over returnValue for notification of completion.