Ensure websockets 1xx response is not treated as an error

This commit is contained in:
Dave Syer
2016-11-15 11:29:19 +00:00
parent 54932c5675
commit 8d48406dfa
2 changed files with 4 additions and 2 deletions

View File

@@ -251,7 +251,7 @@ public class TraceFilter extends GenericFilterBean {
return false;
}
HttpStatus httpStatus = HttpStatus.valueOf(response.getStatus());
return httpStatus.is2xxSuccessful() || httpStatus.is3xxRedirection();
return httpStatus.is1xxInformational() || httpStatus.is2xxSuccessful() || httpStatus.is3xxRedirection();
}
private Span getSpanFromAttribute(HttpServletRequest request) {

View File

@@ -131,7 +131,9 @@ public class DefaultTracer implements Tracer {
}
SpanContextHolder.close(new SpanContextHolder.SpanFunction() {
@Override public void apply(Span span) {
DefaultTracer.this.spanLogger.logStoppedSpan(savedSpan, span);
if (span!=null) {
DefaultTracer.this.spanLogger.logStoppedSpan(savedSpan, span);
}
}
});
}