Search in sources :

Example 71 with SpanRecord

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

the class InvokeInterceptor method beforeTrace.

public SpanRecord beforeTrace(Advice advice) {
    SpanRecord record = new SpanRecord();
    record.setMethod(advice.getBehaviorName());
    record.setService(advice.getBehaviorName());
    record.setRequest(advice.getParameterArray());
    return record;
}
Also used : SpanRecord(com.pamirs.pradar.interceptor.SpanRecord)

Example 72 with SpanRecord

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

the class AbstractRefererCallInterceptor method afterTrace.

@Override
public SpanRecord afterTrace(Advice advice) {
    Object[] args = advice.getParameterArray();
    Request req = (Request) args[0];
    Response result = (Response) advice.getReturnObj();
    SpanRecord record = new SpanRecord();
    record.setRequest(req.getArguments());
    record.setResponse(result.getValue());
    if (result.getException() != null) {
        record.setResultCode(ResultCode.INVOKE_RESULT_FAILED);
        record.setResponse(result.getException());
    }
    return record;
}
Also used : Response(com.weibo.api.motan.rpc.Response) SpanRecord(com.pamirs.pradar.interceptor.SpanRecord) Request(com.weibo.api.motan.rpc.Request)

Example 73 with SpanRecord

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

the class AbstractRefererCallInterceptor method exceptionTrace.

@Override
public SpanRecord exceptionTrace(Advice advice) {
    Object[] args = advice.getParameterArray();
    Request req = (Request) args[0];
    SpanRecord record = new SpanRecord();
    record.setRequest(req.getArguments());
    record.setResponse(advice.getThrowable());
    record.setResultCode(ResultCode.INVOKE_RESULT_FAILED);
    return record;
}
Also used : SpanRecord(com.pamirs.pradar.interceptor.SpanRecord) Request(com.weibo.api.motan.rpc.Request)

Example 74 with SpanRecord

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

the class ProviderMessageRouterCallInterceptor method exceptionTrace.

@Override
public SpanRecord exceptionTrace(Advice advice) {
    Object[] args = advice.getParameterArray();
    SpanRecord record = new SpanRecord();
    Request request = (Request) args[1];
    record.setRequest(request.getArguments());
    record.setResultCode(ResultCode.INVOKE_RESULT_FAILED);
    record.setResponse(advice.getThrowable());
    return record;
}
Also used : SpanRecord(com.pamirs.pradar.interceptor.SpanRecord) Request(com.weibo.api.motan.rpc.Request)

Example 75 with SpanRecord

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

the class ProviderMessageRouterCallInterceptor method afterTrace.

@Override
public SpanRecord afterTrace(Advice advice) {
    Object[] args = advice.getParameterArray();
    SpanRecord record = new SpanRecord();
    Request request = (Request) args[1];
    Response result = (Response) advice.getReturnObj();
    record.setRequest(request.getArguments());
    if (result == null) {
        record.setResultCode(ResultCode.INVOKE_RESULT_SUCCESS);
    } else if (result.getException() != null) {
        record.setResultCode(ResultCode.INVOKE_RESULT_FAILED);
        record.setResponse(result.getException());
    } else {
        record.setResultCode(ResultCode.INVOKE_RESULT_SUCCESS);
        record.setResponse(result.getValue());
    }
    return record;
}
Also used : SpanRecord(com.pamirs.pradar.interceptor.SpanRecord) Response(com.weibo.api.motan.rpc.Response) Request(com.weibo.api.motan.rpc.Request)

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