use of com.pamirs.pradar.interceptor.SpanRecord in project LinkAgent by shulieTech.
the class HessianServletServiceInterceptor method exceptionTrace.
@Override
public SpanRecord exceptionTrace(Advice advice) {
Object[] args = advice.getParameterArray();
Object target = advice.getTarget();
if (args == null || args.length == 0) {
return null;
}
Class<?> type = getType(target, args);
if (type == null) {
return null;
}
SpanRecord spanRecord = new SpanRecord();
spanRecord.setResponse(advice.getThrowable());
spanRecord.setResultCode(ResultCode.INVOKE_RESULT_FAILED);
return spanRecord;
}
use of com.pamirs.pradar.interceptor.SpanRecord in project LinkAgent by shulieTech.
the class ClientInterceptor method afterTrace.
@Override
public SpanRecord afterTrace(Advice advice) {
SpanRecord record = new SpanRecord();
ClientResponse response = (ClientResponse) advice.getReturnObj();
record.setResultCode(String.valueOf(response.getStatus()));
InnerWhiteListCheckUtil.check();
return record;
}
use of com.pamirs.pradar.interceptor.SpanRecord in project LinkAgent by shulieTech.
the class XmemcachedInterceptor method exceptionTrace.
@Override
public SpanRecord exceptionTrace(Advice advice) {
SpanRecord record = new SpanRecord();
record.setResponse(advice.getThrowable());
record.setResultCode(ResultCode.INVOKE_RESULT_FAILED);
record.setMiddlewareName(XmemcachedConstants.MIDDLEWARE_NAME);
return record;
}
use of com.pamirs.pradar.interceptor.SpanRecord in project LinkAgent by shulieTech.
the class XmemcachedInterceptor method beforeTrace.
@Override
public SpanRecord beforeTrace(Advice advice) {
String methodNameExt = XmemcachedUtils.getMethodNameExt(advice.getParameterArray());
SpanRecord record = new SpanRecord();
record.setService(advice.getBehaviorName());
record.setMethod(methodNameExt);
record.setRemoteIp(null);
record.setPort(null);
record.setRequest(toArgs(advice.getParameterArray()));
record.setMiddlewareName(XmemcachedConstants.MIDDLEWARE_NAME);
return record;
}
use of com.pamirs.pradar.interceptor.SpanRecord in project LinkAgent by shulieTech.
the class DubboConsumerInterceptor method beforeTrace.
@Override
public SpanRecord beforeTrace(Advice advice) {
final RpcInvocation invocation = (RpcInvocation) advice.getParameterArray()[0];
final String name = getInterfaceName(invocation);
if (isShentongEvent(name)) {
return null;
}
Invoker<?> invoker = (Invoker<?>) advice.getTarget();
if (isMonitorService(invoker)) {
return null;
}
initConsumer((Invoker<?>) advice.getTarget(), invocation);
RpcContext context = RpcContext.getContext();
String remoteHost = context.getRemoteHost();
if (isLocalHost(remoteHost)) {
remoteHost = PradarCoreUtils.getLocalAddress();
}
SpanRecord record = new SpanRecord();
record.setRemoteIp(remoteHost);
record.setPort(context.getRemotePort());
String version = getVersion(invocation);
record.setService(buildServiceName(name, version));
record.setMethod(context.getMethodName() + DubboUtils.getParameterTypesString(context.getParameterTypes()));
record.setRequestSize(DubboUtils.getRequestSize());
record.setRequest(invocation.getArguments());
record.setPassedCheck(Boolean.parseBoolean(invocation.getAttachment(PradarService.PRADAR_WHITE_LIST_CHECK)));
return record;
}
Aggregations