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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations