You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "wu-sheng (via GitHub)" <gi...@apache.org> on 2023/09/24 06:44:45 UTC
[GitHub] [skywalking-java] wu-sheng commented on a diff in pull request #615: Fix peer when configured as domain for rabbitmq plugin.
wu-sheng commented on code in PR #615:
URL: https://github.com/apache/skywalking-java/pull/615#discussion_r1335133142
##########
apm-sniffer/apm-sdk-plugin/rabbitmq-plugin/src/main/java/org/apache/skywalking/apm/plugin/rabbitmq/ChannelNConstructorInterceptor.java:
##########
@@ -21,12 +21,24 @@
import com.rabbitmq.client.Connection;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor;
+import org.apache.skywalking.apm.util.StringUtil;
public class ChannelNConstructorInterceptor implements InstanceConstructorInterceptor {
@Override
public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
Connection connection = (Connection) allArguments[0];
- String url = connection.getAddress().toString().replace("/", "") + ":" + connection.getPort();
+
+ String[] segments = connection.getAddress().toString().split("/");
Review Comment:
Please use parts. Segments have a special meaning in the agent.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org