def log_async_exit(_name, kvs, span)
      # An asynchronous span can end after the current trace has
      # already completed so we make sure that we end the span
      # on the right trace.

      if tracing? && self.current_trace.id == span.context.trace_id
        self.current_trace.end_async_span(kvs, span)
      else
        # Different trace from current so find the staged trace
        # and close out the span on it.
        trace = ::Instana.processor.staged_trace(span.context.trace_id)
        if trace
          trace.end_async_span(kvs, span)
        else
          ::Instana.logger.debug "#{__method__}: Couldn't find staged trace. #{span.inspect}"
        end
      end
    end
def log_async_exit(_name, kvs, span)
      # An asynchronous span can end after the current trace has
      # already completed so we make sure that we end the span
      # on the right trace.

      if tracing? && self.current_trace.id == span.context.trace_id
        self.current_trace.end_async_span(kvs, span)
      else
        # Different trace from current so find the staged trace
        # and close out the span on it.
        trace = ::Instana.processor.staged_trace(span.context.trace_id)
        if trace
          trace.end_async_span(kvs, span)
        else
          ::Instana.logger.debug "#{__method__}: Couldn't find staged trace. #{span.inspect}"
        end
      end
    end
Closes out an asynchronous span

 @param name [String] the name of the async span to exit (close out)
 @param kvs [Hash] list of key values to be reported in the span
 @param span [Span] the span for this Async op (previously returned
   from `log_async_entry`)