Added a check for tracing in Trace Filter
This commit is contained in:
@@ -210,12 +210,13 @@ public class TraceFilter extends GenericFilterBean {
|
||||
}
|
||||
recordParentSpan(span);
|
||||
// in case of a response with exception status will close the span when exception dispatch is handled
|
||||
if (httpStatusSuccessful(response)) {
|
||||
// checking if tracing is in progress due to async / different order of view controller processing
|
||||
if (httpStatusSuccessful(response) && this.tracer.isTracing()) {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Closing the span " + span + " since the response was successful");
|
||||
}
|
||||
this.tracer.close(span);
|
||||
} else if (errorAlreadyHandled(request)) {
|
||||
} else if (errorAlreadyHandled(request) && this.tracer.isTracing()) {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug(
|
||||
"Won't detach the span " + span + " since error has already been handled");
|
||||
|
||||
@@ -66,7 +66,7 @@ public class TraceHandlerInterceptor extends HandlerInterceptorAdapter {
|
||||
boolean continueSpan = getRootSpanFromAttribute(request) != null;
|
||||
Span span = continueSpan ? getRootSpanFromAttribute(request) : getTracer().createSpan(spanName);
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Created new span " + span + " with name [" + spanName + "]");
|
||||
log.debug("Handling span " + span);
|
||||
}
|
||||
addClassMethodTag(handler, span);
|
||||
addClassNameTag(handler, span);
|
||||
|
||||
Reference in New Issue
Block a user