use of com.netflix.zuul.ZuulFilterResult in project incubator-servicecomb-java-chassis by apache.
the class TracePreZuulFilter method runFilter.
@Override
public ZuulFilterResult runFilter() {
RequestContext ctx = RequestContext.getCurrentContext();
Span span = clientHandler.handleSend(injector, ctx);
saveHeadersAsInvocationContext(ctx, span);
SpanInScope scope = tracer.withSpanInScope(span);
log.debug("Generated tracing span {} for {}", span, ctx.getRequest().getMethod());
ctx.getRequest().setAttribute(SpanInScope.class.getName(), scope);
ZuulFilterResult result = super.runFilter();
log.debug("Result of Zuul filter is [{}]", result.getStatus());
if (ExecutionStatus.SUCCESS != result.getStatus()) {
log.debug("The result of Zuul filter execution was not successful thus will close the current span {}", span);
clientHandler.handleReceive(ctx.getResponse(), result.getException(), span);
scope.close();
}
return result;
}
Aggregations