use of reactor.netty.http.client.HttpClientRequest in project pinpoint by naver.
the class HttpClientOperationsSendInterceptor method doInBeforeTrace.
@Override
public void doInBeforeTrace(SpanEventRecorder recorder, AsyncContext asyncContext, Object target, Object[] args) {
final Trace trace = asyncContext.currentAsyncTraceObject();
if (trace == null) {
if (logger.isWarnEnabled()) {
logger.warn("Unexpected error, Current async trace is null");
}
return;
}
final TraceId nextId = trace.getTraceId().getNextTraceId();
recorder.recordNextSpanId(nextId.getSpanId());
recorder.recordServiceType(ReactorNettyConstants.REACTOR_NETTY_CLIENT);
final HttpClientRequest request = (HttpClientRequest) target;
final ClientRequestWrapper clientRequestWrapper = new HttpClientRequestWrapper(request);
this.requestTraceWriter.write(request, nextId, clientRequestWrapper.getDestinationId());
}
use of reactor.netty.http.client.HttpClientRequest 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);
}
use of reactor.netty.http.client.HttpClientRequest 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;
}
Aggregations