use of org.apache.http.HttpException in project jaeger-client-java by jaegertracing.
the class TracingRequestInterceptor method process.
@Override
public void process(HttpRequest httpRequest, HttpContext httpContext) throws HttpException, IOException {
try {
spanCreationInterceptor.process(httpRequest, httpContext);
Scope currentScope = tracer.scopeManager().active();
if (currentScope != null) {
onSpanStarted(currentScope.span(), httpRequest, httpContext);
} else {
log.warn("Current scope is null; possibly failed to start client tracing span.");
}
spanInjectionInterceptor.process(httpRequest, httpContext);
} catch (Exception e) {
log.error("Could not start client tracing span.", e);
}
}
use of org.apache.http.HttpException in project jaeger-client-java by jaegertracing.
the class TracingResponseInterceptor method process.
@Override
public void process(HttpResponse httpResponse, HttpContext httpContext) throws HttpException, IOException {
try {
Span clientSpan = (Span) httpContext.getAttribute(Constants.CURRENT_SPAN_CONTEXT_KEY);
if (clientSpan != null) {
Tags.HTTP_STATUS.set(clientSpan, httpResponse.getStatusLine().getStatusCode());
beforeSpanFinish(clientSpan, httpResponse, httpContext);
clientSpan.finish();
} else {
log.warn("The ResponseInterceptor did not find a clientSpan. " + "Verify that the RequestInterceptor is correctly set up.");
}
} catch (Exception e) {
log.error("Could not finish client tracing span.", e);
}
}
Aggregations