Loading skywalking-sniffer/skywalking-sdk-plugin/motan-plugin/src/main/java/com/a/eye/skywalking/plugin/motan/MotanConsumerInterceptor.java +5 −6 Original line number Diff line number Diff line Loading @@ -14,12 +14,11 @@ import com.weibo.api.motan.rpc.Request; import com.weibo.api.motan.rpc.Response; import com.weibo.api.motan.rpc.URL; /** * Current trace segment will ref the trace segment from previous level if the serialized context data that fetch * from {@link Request#getAttachments()} is not null. * * {@link MotanConsumerInterceptor} intercept all constructor of {@link com.weibo.api.motan.rpc.AbstractProvider} for record * the request url from consumer side. * {@link MotanProviderInterceptor} create span by fetch request url from * {@link EnhancedClassInstanceContext#context} and transport serialized context * data to provider side through {@link Request#setAttachment(String, String)}. * * @author zhangxin */ Loading Loading @@ -48,7 +47,7 @@ public class MotanConsumerInterceptor implements InstanceConstructorInterceptor, public void beforeMethod(EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext, MethodInterceptResult result) { URL url = (URL) context.get(KEY_NAME_OF_REQUEST_URL); com.weibo.api.motan.rpc.Request request = (com.weibo.api.motan.rpc.Request) interceptorContext.allArguments()[0]; Request request = (Request) interceptorContext.allArguments()[0]; if (url != null) { Span span = ContextManager.INSTANCE.createSpan(generateOperationName(url, request)); Tags.PEER_HOST.set(span, url.getHost()); Loading skywalking-sniffer/skywalking-sdk-plugin/motan-plugin/src/main/java/com/a/eye/skywalking/plugin/motan/MotanProviderInterceptor.java +5 −8 Original line number Diff line number Diff line Loading @@ -13,19 +13,16 @@ import com.weibo.api.motan.rpc.Request; import com.weibo.api.motan.rpc.Response; /** * {@link MotanProviderInterceptor} create span by fetch request url from * {@link EnhancedClassInstanceContext#context} and transport serialized context * data to provider side through {@link Request#setAttachment(String, String)}. * Current trace segment will ref the trace segment if the serialized trace context that fetch * from {@link Request#getAttachments()} is not null. * * {@link MotanConsumerInterceptor} intercept all constructor of {@link com.weibo.api.motan.rpc.AbstractProvider} for record * the request url from consumer side. * * @author zhangxin */ public class MotanProviderInterceptor implements InstanceMethodsAroundInterceptor { /** * Context name of request url in {@link EnhancedClassInstanceContext#context}. */ private static final String CONTEXT_NAME_OF_REQUEST_URL = "REQUEST_URL"; /** * Attachment key of the serialized context data. */ Loading Loading
skywalking-sniffer/skywalking-sdk-plugin/motan-plugin/src/main/java/com/a/eye/skywalking/plugin/motan/MotanConsumerInterceptor.java +5 −6 Original line number Diff line number Diff line Loading @@ -14,12 +14,11 @@ import com.weibo.api.motan.rpc.Request; import com.weibo.api.motan.rpc.Response; import com.weibo.api.motan.rpc.URL; /** * Current trace segment will ref the trace segment from previous level if the serialized context data that fetch * from {@link Request#getAttachments()} is not null. * * {@link MotanConsumerInterceptor} intercept all constructor of {@link com.weibo.api.motan.rpc.AbstractProvider} for record * the request url from consumer side. * {@link MotanProviderInterceptor} create span by fetch request url from * {@link EnhancedClassInstanceContext#context} and transport serialized context * data to provider side through {@link Request#setAttachment(String, String)}. * * @author zhangxin */ Loading Loading @@ -48,7 +47,7 @@ public class MotanConsumerInterceptor implements InstanceConstructorInterceptor, public void beforeMethod(EnhancedClassInstanceContext context, InstanceMethodInvokeContext interceptorContext, MethodInterceptResult result) { URL url = (URL) context.get(KEY_NAME_OF_REQUEST_URL); com.weibo.api.motan.rpc.Request request = (com.weibo.api.motan.rpc.Request) interceptorContext.allArguments()[0]; Request request = (Request) interceptorContext.allArguments()[0]; if (url != null) { Span span = ContextManager.INSTANCE.createSpan(generateOperationName(url, request)); Tags.PEER_HOST.set(span, url.getHost()); Loading
skywalking-sniffer/skywalking-sdk-plugin/motan-plugin/src/main/java/com/a/eye/skywalking/plugin/motan/MotanProviderInterceptor.java +5 −8 Original line number Diff line number Diff line Loading @@ -13,19 +13,16 @@ import com.weibo.api.motan.rpc.Request; import com.weibo.api.motan.rpc.Response; /** * {@link MotanProviderInterceptor} create span by fetch request url from * {@link EnhancedClassInstanceContext#context} and transport serialized context * data to provider side through {@link Request#setAttachment(String, String)}. * Current trace segment will ref the trace segment if the serialized trace context that fetch * from {@link Request#getAttachments()} is not null. * * {@link MotanConsumerInterceptor} intercept all constructor of {@link com.weibo.api.motan.rpc.AbstractProvider} for record * the request url from consumer side. * * @author zhangxin */ public class MotanProviderInterceptor implements InstanceMethodsAroundInterceptor { /** * Context name of request url in {@link EnhancedClassInstanceContext#context}. */ private static final String CONTEXT_NAME_OF_REQUEST_URL = "REQUEST_URL"; /** * Attachment key of the serialized context data. */ Loading