use of com.creditease.uav.apm.invokechain.span.Span in project uavstack by uavorg.
the class DubboConsumerAdapter method afterDoCap.
@Override
public void afterDoCap(InvokeChainContext context, Object[] args) {
if (UAVServer.instance().isExistSupportor("com.creditease.uav.apm.supporters.SlowOperSupporter")) {
Span span = (Span) context.get(InvokeChainConstants.PARAM_SPAN_KEY);
if (span == null) {
return;
}
SlowOperContext slowOperContext = new SlowOperContext();
// 根据返回码确定当前是否有异常(由于IT位置已经解析过,此处直接使用)
int respCode = (Integer) context.get(CaptureConstants.INFO_CLIENT_RESPONSECODE);
if (respCode == -1) {
slowOperContext.put(SlowOperConstants.PROTOCOL_METHOD_RETURN, parseReturn(context.get(CaptureConstants.INFO_CLIENT_RESPONSESTATE)));
} else {
Result result = (Result) args[2];
slowOperContext.put(SlowOperConstants.PROTOCOL_METHOD_RETURN, parseReturn(result.getValue()));
}
Object[] params = { span, slowOperContext };
UAVServer.instance().runSupporter("com.creditease.uav.apm.supporters.SlowOperSupporter", "runCap", span.getEndpointInfo().split(",")[0], InvokeChainConstants.CapturePhase.DOCAP, context, params);
}
}
use of com.creditease.uav.apm.invokechain.span.Span in project uavstack by uavorg.
the class DubboProviderAdapter method afterDoCap.
@Override
public void afterDoCap(InvokeChainContext context, Object[] args) {
if (UAVServer.instance().isExistSupportor("com.creditease.uav.apm.supporters.SlowOperSupporter")) {
String url = (String) context.get(CaptureConstants.INFO_APPSERVER_CONNECTOR_REQUEST_URL);
Span span = this.spanFactory.getRemoveSpanFromContext(url);
if (span == null) {
return;
}
SlowOperContext slowOperContext = new SlowOperContext();
// 根据返回码确定当前是否有异常(由于IT位置已经解析过,此处直接使用)
String respCode = (String) context.get(CaptureConstants.INFO_APPSERVER_CONNECTOR_RESPONSECODE);
if (respCode.equals("-1")) {
slowOperContext.put(SlowOperConstants.PROTOCOL_METHOD_RETURN, parseReturn(context.get(CaptureConstants.INFO_APPSERVER_CONNECTOR_RESPONSESTATE)));
} else {
Result result = (Result) args[2];
slowOperContext.put(SlowOperConstants.PROTOCOL_METHOD_RETURN, parseReturn(result.getValue()));
}
Object[] params = { span, slowOperContext };
UAVServer.instance().runSupporter("com.creditease.uav.apm.supporters.SlowOperSupporter", "runCap", span.getEndpointInfo().split(",")[0], InvokeChainConstants.CapturePhase.DOCAP, context, params);
}
}
use of com.creditease.uav.apm.invokechain.span.Span in project uavstack by uavorg.
the class DubboProviderAdapter method afterPreCap.
@Override
public void afterPreCap(InvokeChainContext context, Object[] args) {
String url = (String) context.get(CaptureConstants.INFO_APPSERVER_CONNECTOR_REQUEST_URL);
Span span = this.spanFactory.getSpanFromContext(url);
if (UAVServer.instance().isExistSupportor("com.creditease.uav.apm.supporters.SlowOperSupporter")) {
SlowOperContext slowOperContext = new SlowOperContext();
// dubbo虽属于rpc,但从其使用方式上属于方法级
Invocation invocation = (Invocation) args[1];
slowOperContext.put(SlowOperConstants.PROTOCOL_METHOD_PARAMS, parseParams(invocation.getArguments()));
Object[] params = { span, slowOperContext };
UAVServer.instance().runSupporter("com.creditease.uav.apm.supporters.SlowOperSupporter", "runCap", span.getEndpointInfo().split(",")[0], InvokeChainConstants.CapturePhase.PRECAP, context, params);
}
}
use of com.creditease.uav.apm.invokechain.span.Span in project uavstack by uavorg.
the class RocketMQPushConsumerAdapter method afterDoCap.
@Override
public void afterDoCap(InvokeChainContext context, Object[] args) {
if (UAVServer.instance().isExistSupportor("com.creditease.uav.apm.supporters.SlowOperSupporter")) {
Span span = (Span) context.get(InvokeChainConstants.PARAM_SPAN_KEY);
if (span == null) {
return;
}
Object[] params = { span };
UAVServer.instance().runSupporter("com.creditease.uav.apm.supporters.SlowOperSupporter", "runCap", span.getEndpointInfo().split(",")[0], InvokeChainConstants.CapturePhase.DOCAP, context, params);
}
}
use of com.creditease.uav.apm.invokechain.span.Span in project uavstack by uavorg.
the class RocketMQPushConsumerAdapter method beforeDoCap.
@Override
public void beforeDoCap(InvokeChainContext context, Object[] args) {
String storeKey = (String) context.get(InvokeChainConstants.CLIENT_SPAN_THREADLOCAL_STOREKEY);
Span span = this.spanFactory.getSpanFromContext(storeKey);
if (span != null) {
span.setClassName((String) context.get(InvokeChainConstants.CLIENT_IT_CLASS));
span.setMethodName((String) context.get(InvokeChainConstants.CLIENT_IT_METHOD));
}
}
Aggregations