use of com.navercorp.pinpoint.plugin.okhttp.UserResponseGetter in project pinpoint by naver.
the class HttpEngineReadResponseMethodInterceptor 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;
}
if (!validate(target)) {
return;
}
try {
SpanEventRecorder recorder = trace.currentSpanEventRecorder();
recorder.recordApi(methodDescriptor);
recorder.recordException(throwable);
if (statusCode) {
// type check validate();
Response response = ((UserResponseGetter) target)._$PINPOINT$_getUserResponse();
if (response != null) {
recorder.recordAttribute(AnnotationKey.HTTP_STATUS_CODE, response.code());
}
}
} finally {
trace.traceBlockEnd();
}
}
Aggregations