class SpanCustomizingAsyncHandlerInterceptor extends HandlerInterceptorAdapter {

  @Override
  public void afterCompletion(
    HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
    Object span = request.getAttribute(SpanCustomizer.class.getName());
    if (span instanceof SpanCustomizer) {
      setErrorAttribute(request, ex);
      setHttpRouteAttribute(request);
    }
  }

    SpanCustomizingAsyncHandlerInterceptor();

}