Search in sources :

Example 1 with HttpClient3RequestWrapper

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();
    }
}
Also used : Trace(com.navercorp.pinpoint.bootstrap.context.Trace) ClientRequestWrapper(com.navercorp.pinpoint.bootstrap.plugin.request.ClientRequestWrapper) HttpConnection(org.apache.commons.httpclient.HttpConnection) HttpClient3CallContext(com.navercorp.pinpoint.plugin.httpclient3.HttpClient3CallContext) SpanEventRecorder(com.navercorp.pinpoint.bootstrap.context.SpanEventRecorder) HttpClient3RequestWrapper(com.navercorp.pinpoint.plugin.httpclient3.HttpClient3RequestWrapper) HttpMethod(org.apache.commons.httpclient.HttpMethod)

Aggregations

SpanEventRecorder (com.navercorp.pinpoint.bootstrap.context.SpanEventRecorder)1 Trace (com.navercorp.pinpoint.bootstrap.context.Trace)1 ClientRequestWrapper (com.navercorp.pinpoint.bootstrap.plugin.request.ClientRequestWrapper)1 HttpClient3CallContext (com.navercorp.pinpoint.plugin.httpclient3.HttpClient3CallContext)1 HttpClient3RequestWrapper (com.navercorp.pinpoint.plugin.httpclient3.HttpClient3RequestWrapper)1 HttpConnection (org.apache.commons.httpclient.HttpConnection)1 HttpMethod (org.apache.commons.httpclient.HttpMethod)1