Search in sources :

Example 1 with ConnectionGetter

use of com.navercorp.pinpoint.plugin.okhttp.v2.ConnectionGetter in project pinpoint by naver.

the class HttpEngineConnectMethodInterceptor method doInAfterTrace.

@Override
protected void doInAfterTrace(SpanEventRecorder recorder, Object target, Object[] args, Object result, Throwable throwable) {
    recorder.recordApi(methodDescriptor);
    recorder.recordServiceType(OkHttpConstants.OK_HTTP_CLIENT_INTERNAL);
    recorder.recordException(throwable);
    if (target instanceof ConnectionGetter) {
        final Connection connection = ((ConnectionGetter) target)._$PINPOINT$_getConnection();
        if (connection != null) {
            final String hostAndPort = getHostAndPort(connection);
            recorder.recordAttribute(AnnotationKey.HTTP_INTERNAL_DISPLAY, hostAndPort);
        }
    }
}
Also used : Connection(com.squareup.okhttp.Connection) ConnectionGetter(com.navercorp.pinpoint.plugin.okhttp.v2.ConnectionGetter)

Aggregations

ConnectionGetter (com.navercorp.pinpoint.plugin.okhttp.v2.ConnectionGetter)1 Connection (com.squareup.okhttp.Connection)1