use of com.navercorp.pinpoint.bootstrap.plugin.request.ClientRequestWrapper in project pinpoint by naver.
the class PromiseImplInterceptor method doInAfterTrace.
@Override
public void doInAfterTrace(SpanEventRecorder recorder, Object target, Object[] args, Object result, Throwable throwable) {
recorder.recordApi(methodDescriptor);
recorder.recordException(throwable);
recorder.recordServiceType(VertxConstants.VERTX_HTTP_CLIENT);
final HttpClientRequest request = (HttpClientRequest) args[0];
String host = request.getHost();
if (host == null) {
host = "UNKNOWN";
}
final ClientRequestWrapper clientRequest = new HttpClientRequestWrapper(request, host);
this.clientRequestRecorder.record(recorder, clientRequest, throwable);
this.cookieRecorder.record(recorder, request, throwable);
}
use of com.navercorp.pinpoint.bootstrap.plugin.request.ClientRequestWrapper 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();
}
}
use of com.navercorp.pinpoint.bootstrap.plugin.request.ClientRequestWrapper in project pinpoint by naver.
the class DefaultClientExchangeHandlerImplStartMethodInterceptor 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 {
SpanEventRecorder recorder = trace.currentSpanEventRecorder();
final HttpRequest httpRequest = getHttpRequest(target);
final NameIntValuePair<String> host = getHost(target);
if (httpRequest != null) {
// Accessing httpRequest here not BEFORE() because it can cause side effect.
ClientRequestWrapper clientRequest = new HttpClient4RequestWrapper(httpRequest, host.getName(), host.getValue());
this.clientRequestRecorder.record(recorder, clientRequest, throwable);
this.cookieRecorder.record(recorder, httpRequest, throwable);
this.entityRecorder.record(recorder, httpRequest, throwable);
}
recorder.recordApi(methodDescriptor);
recorder.recordException(throwable);
} finally {
trace.traceBlockEnd();
}
}
use of com.navercorp.pinpoint.bootstrap.plugin.request.ClientRequestWrapper in project pinpoint by naver.
the class HttpClientOperationsSendInterceptor method doInAfterTrace.
@Override
public void doInAfterTrace(SpanEventRecorder recorder, Object target, Object[] args, Object result, Throwable throwable) {
recorder.recordApi(methodDescriptor);
recorder.recordException(throwable);
final HttpClientRequest request = (HttpClientRequest) target;
final ClientRequestWrapper clientRequestWrapper = new HttpClientRequestWrapper(request);
this.clientRequestRecorder.record(recorder, clientRequestWrapper, throwable);
}
Aggregations