Search in sources :

Example 36 with SpanRecord

use of com.pamirs.pradar.interceptor.SpanRecord in project LinkAgent by shulieTech.

the class Neo4jSessionOperationTraceInterceptor method afterTrace.

@Override
public SpanRecord afterTrace(Advice advice) {
    Object[] args = advice.getParameterArray();
    String methodName = advice.getBehaviorName();
    Object target = advice.getTarget();
    Object result = advice.getReturnObj();
    SpanRecord record = new SpanRecord();
    record.setService(target.getClass().getName());
    record.setMethod(getMethodName(methodName, args));
    record.setRequest(args);
    record.setResponse(result);
    record.setResultCode(ResultCode.INVOKE_RESULT_SUCCESS);
    return record;
}
Also used : SpanRecord(com.pamirs.pradar.interceptor.SpanRecord)

Example 37 with SpanRecord

use of com.pamirs.pradar.interceptor.SpanRecord in project LinkAgent by shulieTech.

the class JedisInterceptor method afterTrace.

@Override
public SpanRecord afterTrace(Advice advice) {
    Object result = advice.getReturnObj();
    SpanRecord record = new SpanRecord();
    record.setResponse(result);
    record.setResultCode(ResultCode.INVOKE_RESULT_SUCCESS);
    record.setMiddlewareName(RedisConstants.MIDDLEWARE_NAME);
    attachment(advice, 0);
    return record;
}
Also used : SpanRecord(com.pamirs.pradar.interceptor.SpanRecord)

Example 38 with SpanRecord

use of com.pamirs.pradar.interceptor.SpanRecord in project LinkAgent by shulieTech.

the class JedisInterceptor method exceptionTrace.

@Override
public SpanRecord exceptionTrace(Advice advice) {
    SpanRecord record = new SpanRecord();
    record.setResponse(advice.getThrowable());
    record.setResultCode(ResultCode.INVOKE_RESULT_FAILED);
    record.setMiddlewareName(RedisConstants.MIDDLEWARE_NAME);
    return record;
}
Also used : SpanRecord(com.pamirs.pradar.interceptor.SpanRecord)

Example 39 with SpanRecord

use of com.pamirs.pradar.interceptor.SpanRecord in project LinkAgent by shulieTech.

the class JedisInterceptor method beforeTrace.

@Override
public SpanRecord beforeTrace(Advice advice) {
    Object[] args = advice.getParameterArray();
    String methodName = advice.getBehaviorName();
    Object target = advice.getTarget();
    SpanRecord record = new SpanRecord();
    record.setService(methodName);
    record.setMethod(methodName);
    record.setRequestSize(0);
    Client client = getClient(target);
    record.setRemoteIp(client.getHost());
    record.setPort(client.getPort());
    // record.setCallbackMsg(client.getDB()+"");
    record.setRequest(toArgs(args));
    record.setMiddlewareName(RedisConstants.MIDDLEWARE_NAME);
    return record;
}
Also used : SpanRecord(com.pamirs.pradar.interceptor.SpanRecord)

Example 40 with SpanRecord

use of com.pamirs.pradar.interceptor.SpanRecord in project LinkAgent by shulieTech.

the class ChannelNBasicPublishInterceptor method afterTrace.

@Override
public SpanRecord afterTrace(Advice advice) {
    Object[] args = advice.getParameterArray();
    if (args == null || args.length == 0) {
        return null;
    }
    SpanRecord record = new SpanRecord();
    return record;
}
Also used : SpanRecord(com.pamirs.pradar.interceptor.SpanRecord)

Aggregations

SpanRecord (com.pamirs.pradar.interceptor.SpanRecord)199 JSONObject (com.alibaba.fastjson.JSONObject)19 SocketTimeoutException (java.net.SocketTimeoutException)15 ConsumerRecord (org.apache.kafka.clients.consumer.ConsumerRecord)13 ReflectException (com.shulie.instrument.simulator.api.reflect.ReflectException)11 HashMap (java.util.HashMap)10 List (java.util.List)8 PressureMeasureError (com.pamirs.pradar.exception.PressureMeasureError)6 Request (com.weibo.api.motan.rpc.Request)6 HeaderProcessor (com.pamirs.attach.plugin.apache.kafka.header.HeaderProcessor)5 WrapperRequest (com.pamirs.attach.plugin.hessian.common.WrapperRequest)5 URI (java.net.URI)5 HttpServletRequest (javax.servlet.http.HttpServletRequest)5 Metadata (io.grpc.Metadata)4 ServerAddress (com.mongodb.ServerAddress)3 Channel (com.rabbitmq.client.Channel)3 Connection (com.rabbitmq.client.Connection)3 Field (java.lang.reflect.Field)3 Method (java.lang.reflect.Method)3 URL (java.net.URL)3