Search in sources :

Example 66 with SpanRecord

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

the class DubboConsumerInterceptor method exceptionTrace.

@Override
public SpanRecord exceptionTrace(Advice advice) {
    final RpcInvocation invocation = (RpcInvocation) advice.getParameterArray()[0];
    final String name = getInterfaceName(invocation);
    if (isShentongEvent(name)) {
        return null;
    }
    SpanRecord record = new SpanRecord();
    record.setResponseSize(0);
    record.setResponse(advice.getThrowable());
    record.setResultCode(DubboUtils.getResultCode(advice.getThrowable()));
    return record;
}
Also used : SpanRecord(com.pamirs.pradar.interceptor.SpanRecord)

Example 67 with SpanRecord

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

the class DubboProviderInterceptor method exceptionTrace.

@Override
public SpanRecord exceptionTrace(Advice advice) {
    SpanRecord record = new SpanRecord();
    RpcInvocation invocation = (RpcInvocation) advice.getParameterArray()[0];
    final String interfaceName = getInterfaceName(invocation);
    if (isShentongEvent(interfaceName)) {
        return null;
    }
    record.setRequest(invocation.getArguments());
    record.setResponse(advice.getThrowable());
    record.setResultCode(getResultCode(advice.getThrowable()));
    return record;
}
Also used : SpanRecord(com.pamirs.pradar.interceptor.SpanRecord)

Example 68 with SpanRecord

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

the class AbstractKStreamProcessorProcessInterceptor method afterTrace.

@Override
public SpanRecord afterTrace(Advice advice) {
    SpanRecord spanRecord = new SpanRecord();
    spanRecord.setResponse(advice.getReturnObj());
    return spanRecord;
}
Also used : SpanRecord(com.pamirs.pradar.interceptor.SpanRecord)

Example 69 with SpanRecord

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

the class CallInvokeInterceptor method beforeTrace.

public SpanRecord beforeTrace(Advice advice) {
    Call call = (Call) advice.getTarget();
    final MessageContext messageContext = call.getMessageContext();
    String operationName = call.getOperationName().toString();
    String serviceName = call.getTargetEndpointAddress();
    SpanRecord record = new SpanRecord();
    record.setService(serviceName);
    record.setMethod(operationName);
    record.setRequest(messageContext.getMessage());
    try {
        URI uri = URI.create(serviceName);
        String host = uri.getHost();
        record.setRemoteIp(host);
        record.setPort(uri.getHost());
    } catch (Throwable var11) {
    }
    return record;
}
Also used : SpanRecord(com.pamirs.pradar.interceptor.SpanRecord) Call(org.apache.axis.client.Call) MessageContext(org.apache.axis.MessageContext) URI(java.net.URI)

Example 70 with SpanRecord

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

the class InvokeInterceptor method afterTrace.

public SpanRecord afterTrace(Advice advice) {
    SpanRecord record = new SpanRecord();
    record.setMethod(advice.getBehaviorName());
    record.setService(advice.getBehaviorName());
    record.setRequest(advice.getParameterArray());
    record.setResponse(advice.getReturnObj());
    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