use of com.navercorp.pinpoint.plugin.httpclient3.HttpClient3RequestWrapper in project pinpoint by naver.
the class HttpMethodBaseExecuteMethodInterceptor method after.
@Override
public void after(Object target, Object[] args, Object result, Throwable throwable) {
if (isDebug) {
logger.afterInterceptor(target, args);
}
final Trace trace = traceContext.currentTraceObject();
if (trace == null) {
return;
}
try {
final SpanEventRecorder recorder = trace.currentSpanEventRecorder();
recorder.recordApi(descriptor);
recorder.recordException(throwable);
if (target instanceof HttpMethod) {
final HttpMethod httpMethod = (HttpMethod) target;
final HttpConnection httpConnection = getHttpConnection(args);
final ClientRequestWrapper requestWrapper = new HttpClient3RequestWrapper(httpMethod, httpConnection);
this.clientRequestRecorder.record(recorder, requestWrapper, throwable);
this.cookieRecorder.record(recorder, httpMethod, throwable);
this.entityRecorder.record(recorder, httpMethod, throwable);
this.responseHeaderRecorder.recordHeader(recorder, httpMethod);
}
if (result != null) {
recorder.recordAttribute(AnnotationKey.HTTP_STATUS_CODE, result);
}
final HttpClient3CallContext callContext = getAndCleanAttachment();
if (callContext != null) {
recordIo(recorder, callContext);
}
} finally {
trace.traceBlockEnd();
}
}
Aggregations