Search in sources :

Example 1 with HttpClientRequest

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());
}
Also used : Trace(com.navercorp.pinpoint.bootstrap.context.Trace) HttpClientRequest(reactor.netty.http.client.HttpClientRequest) ClientRequestWrapper(com.navercorp.pinpoint.bootstrap.plugin.request.ClientRequestWrapper) TraceId(com.navercorp.pinpoint.bootstrap.context.TraceId)

Example 2 with HttpClientRequest

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);
}
Also used : HttpClientRequest(reactor.netty.http.client.HttpClientRequest) ClientRequestWrapper(com.navercorp.pinpoint.bootstrap.plugin.request.ClientRequestWrapper)

Example 3 with HttpClientRequest

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;
}
Also used : HttpClientRequest(reactor.netty.http.client.HttpClientRequest) AsyncContext(com.navercorp.pinpoint.bootstrap.context.AsyncContext)

Aggregations

HttpClientRequest (reactor.netty.http.client.HttpClientRequest)3 ClientRequestWrapper (com.navercorp.pinpoint.bootstrap.plugin.request.ClientRequestWrapper)2 AsyncContext (com.navercorp.pinpoint.bootstrap.context.AsyncContext)1 Trace (com.navercorp.pinpoint.bootstrap.context.Trace)1 TraceId (com.navercorp.pinpoint.bootstrap.context.TraceId)1