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
committed by Marcin Grzejszczak
parent 06ab758d69
commit ea9553cef7
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

@@ -140,7 +140,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);
}
}
});
}