Should detach span from trace filter for async; fixes #728
This commit is contained in:
@@ -172,9 +172,9 @@ public class TraceFilter extends GenericFilterBean {
|
||||
} finally {
|
||||
if (isAsyncStarted(request) || request.isAsyncStarted()) {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("The span " + spanFromRequest + " will get detached by a HandleInterceptor");
|
||||
log.debug("The span " + this.tracer.getCurrentSpan() + " will get detached");
|
||||
}
|
||||
// TODO: how to deal with response annotations and async?
|
||||
this.tracer.detach(this.tracer.getCurrentSpan());
|
||||
return;
|
||||
}
|
||||
detachOrCloseSpans(request, response, spanFromRequest, exception);
|
||||
|
||||
@@ -68,6 +68,7 @@ public class TraceHandlerInterceptor extends HandlerInterceptorAdapter {
|
||||
String spanName = spanName(handler);
|
||||
boolean continueSpan = getRootSpanFromAttribute(request) != null;
|
||||
Span span = continueSpan ? getRootSpanFromAttribute(request) : getTracer().createSpan(spanName);
|
||||
getTracer().continueSpan(span);
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Handling span " + span);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user