Package brave.spring.webmvc
Class SpanCustomizingHandlerInterceptor
java.lang.Object
brave.spring.webmvc.SpanCustomizingHandlerInterceptor
- All Implemented Interfaces:
org.springframework.web.servlet.HandlerInterceptor
public final class SpanCustomizingHandlerInterceptor extends Object implements org.springframework.web.servlet.HandlerInterceptor
Adds application-tier data to an existing http span via
HandlerParser
. This also sets the
request property "http.route" so that it can be used in naming the http span.
Use this when you start traces at the servlet layer via TracingFilter
.
-
Method Summary
Modifier and Type Method Description void
afterCompletion(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler, Exception ex)
Sets the "error" attribute so that theTracingFilter
can read it.void
postHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler, org.springframework.web.servlet.ModelAndView modelAndView)
boolean
preHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object o)
Parses the request and sets the "http.route" attribute so that theTracingFilter
can read it.
-
Method Details
-
preHandle
public boolean preHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object o)Parses the request and sets the "http.route" attribute so that theTracingFilter
can read it.- Specified by:
preHandle
in interfaceorg.springframework.web.servlet.HandlerInterceptor
-
postHandle
public void postHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler, org.springframework.web.servlet.ModelAndView modelAndView)- Specified by:
postHandle
in interfaceorg.springframework.web.servlet.HandlerInterceptor
-
afterCompletion
public void afterCompletion(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler, Exception ex)Sets the "error" attribute so that theTracingFilter
can read it.- Specified by:
afterCompletion
in interfaceorg.springframework.web.servlet.HandlerInterceptor
-