未验证 提交 e9622033 编写于 作者: F Frank Liu 提交者: GitHub

Dubbo link tracing- show "group" attribute value in OperationName (#6159)

上级 5fd06a7c
...@@ -27,6 +27,7 @@ Release Notes. ...@@ -27,6 +27,7 @@ Release Notes.
* Add Dolphinscheduler plugin definition. * Add Dolphinscheduler plugin definition.
* Make sampling still works when the trace ignores plug-in activation. * Make sampling still works when the trace ignores plug-in activation.
* Fix mssql-plugin occur ClassCastException when call the method of return generate key. * Fix mssql-plugin occur ClassCastException when call the method of return generate key.
* The operation name of dubbo and dubbo-2.7.x-plugin, has been changed as the `groupValue/className.methodName` format
* Fix bug that rocketmq-plugin set the wrong tag. * Fix bug that rocketmq-plugin set the wrong tag.
#### OAP-Backend #### OAP-Backend
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
package org.apache.skywalking.apm.plugin.asf.dubbo; package org.apache.skywalking.apm.plugin.asf.dubbo;
import org.apache.dubbo.common.Constants;
import org.apache.dubbo.common.URL; import org.apache.dubbo.common.URL;
import org.apache.dubbo.rpc.Invocation; import org.apache.dubbo.rpc.Invocation;
import org.apache.dubbo.rpc.Invoker; import org.apache.dubbo.rpc.Invoker;
...@@ -33,6 +34,7 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedI ...@@ -33,6 +34,7 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedI
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor; import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult; import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
import org.apache.skywalking.apm.network.trace.component.ComponentsDefine; import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
import org.apache.skywalking.apm.util.StringUtil;
import java.lang.reflect.Method; import java.lang.reflect.Method;
...@@ -136,6 +138,9 @@ public class DubboInterceptor implements InstanceMethodsAroundInterceptor { ...@@ -136,6 +138,9 @@ public class DubboInterceptor implements InstanceMethodsAroundInterceptor {
*/ */
private String generateOperationName(URL requestURL, Invocation invocation) { private String generateOperationName(URL requestURL, Invocation invocation) {
StringBuilder operationName = new StringBuilder(); StringBuilder operationName = new StringBuilder();
String groupStr = requestURL.getParameter(Constants.GROUP_KEY);
groupStr = StringUtil.isEmpty(groupStr) ? "" : groupStr + "/";
operationName.append(groupStr);
operationName.append(requestURL.getPath()); operationName.append(requestURL.getPath());
operationName.append("." + invocation.getMethodName() + "("); operationName.append("." + invocation.getMethodName() + "(");
for (Class<?> classes : invocation.getParameterTypes()) { for (Class<?> classes : invocation.getParameterTypes()) {
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
package org.apache.skywalking.apm.plugin.dubbo; package org.apache.skywalking.apm.plugin.dubbo;
import com.alibaba.dubbo.common.Constants;
import com.alibaba.dubbo.common.URL; import com.alibaba.dubbo.common.URL;
import com.alibaba.dubbo.rpc.Invocation; import com.alibaba.dubbo.rpc.Invocation;
import com.alibaba.dubbo.rpc.Invoker; import com.alibaba.dubbo.rpc.Invoker;
...@@ -34,6 +35,7 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedI ...@@ -34,6 +35,7 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedI
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor; import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult; import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
import org.apache.skywalking.apm.network.trace.component.ComponentsDefine; import org.apache.skywalking.apm.network.trace.component.ComponentsDefine;
import org.apache.skywalking.apm.util.StringUtil;
/** /**
* {@link DubboInterceptor} define how to enhance class {@link com.alibaba.dubbo.monitor.support.MonitorFilter#invoke(Invoker, * {@link DubboInterceptor} define how to enhance class {@link com.alibaba.dubbo.monitor.support.MonitorFilter#invoke(Invoker,
...@@ -123,6 +125,9 @@ public class DubboInterceptor implements InstanceMethodsAroundInterceptor { ...@@ -123,6 +125,9 @@ public class DubboInterceptor implements InstanceMethodsAroundInterceptor {
*/ */
private String generateOperationName(URL requestURL, Invocation invocation) { private String generateOperationName(URL requestURL, Invocation invocation) {
StringBuilder operationName = new StringBuilder(); StringBuilder operationName = new StringBuilder();
String groupStr = requestURL.getParameter(Constants.GROUP_KEY);
groupStr = StringUtil.isEmpty(groupStr) ? "" : groupStr + "/";
operationName.append(groupStr);
operationName.append(requestURL.getPath()); operationName.append(requestURL.getPath());
operationName.append("." + invocation.getMethodName() + "("); operationName.append("." + invocation.getMethodName() + "(");
for (Class<?> classes : invocation.getParameterTypes()) { for (Class<?> classes : invocation.getParameterTypes()) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册