You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2019/09/02 14:18:45 UTC

[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #3390: MOD: Modify compatibility of kafka plugin and expand operationName

kezhenxu94 commented on a change in pull request #3390: MOD: Modify compatibility of kafka plugin and expand operationName
URL: https://github.com/apache/skywalking/pull/3390#discussion_r319975325
 
 

 ##########
 File path: apm-sniffer/apm-sdk-plugin/kafka-plugin/src/main/java/org/apache/skywalking/apm/plugin/kafka/ProducerConstructorMapInterceptor.java
 ##########
 @@ -16,14 +16,21 @@
  *
  */
 
-package org.apache.skywalking.apm.plugin.kafka.v1;
+package org.apache.skywalking.apm.plugin.kafka;
 
 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 ProducerRecordConstructorInterceptor implements InstanceConstructorInterceptor {
-    @Override public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
-        String topic = (String)allArguments[0];
-        objInst.setSkyWalkingDynamicField(topic);
+import java.util.Map;
+
+/**
+ * @author stalary
+ */
+public class ProducerConstructorMapInterceptor implements InstanceConstructorInterceptor {
+    @Override
+    public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
+        Map<String, Object> config = (Map<String, Object>) allArguments[0];
+        objInst.setSkyWalkingDynamicField(StringUtil.join(';', ((String) config.get("bootstrap.servers")).split(",")));
 
 Review comment:
   The `bootstrap.servers` is just for tagging, right? Do we really need to spilt it with `,` and join them with another delimiter `;` ? What about just setting them **AS IS**

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services