use of com.navercorp.pinpoint.bootstrap.context.AsyncContext in project pinpoint by naver.
the class HttpClientHandlerConstructorInterceptor method doInAfterTrace.
@Override
public void doInAfterTrace(SpanEventRecorder recorder, Object target, Object[] args, Object result, Throwable throwable) throws Exception {
recorder.recordApi(methodDescriptor);
recorder.recordException(throwable);
recorder.recordServiceType(ReactorNettyConstants.REACTOR_NETTY_CLIENT_INTERNAL);
if (throwable == null && target instanceof AsyncContextAccessor) {
final AsyncContext asyncContext = recorder.recordNextAsyncContext();
((AsyncContextAccessor) target)._$PINPOINT$_setAsyncContext(asyncContext);
}
}
use of com.navercorp.pinpoint.bootstrap.context.AsyncContext in project pinpoint by naver.
the class HttpClientOperationsSendInterceptor method getAsyncContext.
// BEFORE
@Override
public AsyncContext getAsyncContext(Object target, Object[] args) {
if (Boolean.FALSE == validate(target)) {
return null;
}
final HttpClientRequest request = (HttpClientRequest) target;
final AsyncContext asyncContext = AsyncContextAccessorUtils.getAsyncContext(target);
if (asyncContext == null) {
// Set sampling rate to false
this.requestTraceWriter.write(request);
return null;
}
return asyncContext;
}
use of com.navercorp.pinpoint.bootstrap.context.AsyncContext in project pinpoint by naver.
the class SchedulerAndWorkerScheduleMethodInterceptor method doInAfterTrace.
// Disposable schedule(Runnable task);
// Disposable schedule(Runnable task, long delay, TimeUnit unit)
// Disposable schedulePeriodically(Runnable task, long initialDelay, long period, TimeUnit unit)
@Override
public void doInAfterTrace(SpanEventRecorder recorder, Object target, Object[] args, Object result, Throwable throwable) {
recorder.recordApi(methodDescriptor);
recorder.recordException(throwable);
recorder.recordServiceType(ReactorConstants.REACTOR_NETTY);
if (isAsynchronousInvocation(target, args, result, throwable)) {
// Trace to Disposable object
final AsyncContext asyncContext = recorder.recordNextAsyncContext();
((AsyncContextAccessor) (result))._$PINPOINT$_setAsyncContext(asyncContext);
}
}
use of com.navercorp.pinpoint.bootstrap.context.AsyncContext in project pinpoint by naver.
the class LettuceMethodInterceptor method doInAfterTrace.
@Override
public void doInAfterTrace(SpanEventRecorder recorder, Object target, Object[] args, Object result, Throwable throwable) {
final String endPoint = toEndPoint(target);
recorder.recordApi(getMethodDescriptor());
recorder.recordEndPoint(endPoint != null ? endPoint : "Unknown");
recorder.recordDestinationId(LettuceConstants.REDIS_LETTUCE.getName());
recorder.recordServiceType(LettuceConstants.REDIS_LETTUCE);
recorder.recordException(throwable);
if (result instanceof AsyncContextAccessor) {
if (AsyncContextAccessorUtils.getAsyncContext(result) == null) {
// Avoid duplicate async context
final AsyncContext asyncContext = recorder.recordNextAsyncContext();
((AsyncContextAccessor) result)._$PINPOINT$_setAsyncContext(asyncContext);
}
}
}
use of com.navercorp.pinpoint.bootstrap.context.AsyncContext in project pinpoint by naver.
the class HttpTcpClientConnectInterceptor method doInAfterTrace.
@Override
public void doInAfterTrace(SpanEventRecorder recorder, Object target, Object[] args, Object result, Throwable throwable) throws Exception {
recorder.recordApi(methodDescriptor);
recorder.recordException(throwable);
recorder.recordServiceType(ReactorNettyConstants.REACTOR_NETTY_CLIENT_INTERNAL);
if (result instanceof AsyncContextAccessor) {
// Set MonoHttpConnect
final AsyncContext asyncContext = recorder.recordNextAsyncContext();
((AsyncContextAccessor) result)._$PINPOINT$_setAsyncContext(asyncContext);
}
}
Aggregations