zipkin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [incubator-zipkin-brave] branch messaging updated: fix: use identifier on producer side only
Date Mon, 20 May 2019 10:47:09 GMT
This is an automated email from the ASF dual-hosted git repository.

jeqo pushed a commit to branch messaging
in repository https://gitbox.apache.org/repos/asf/incubator-zipkin-brave.git


The following commit(s) were added to refs/heads/messaging by this push:
     new f58c87a  fix: use identifier on producer side only
f58c87a is described below

commit f58c87a2dc1ff2a91f3c4ac58c8eca5f373dc3c2
Author: Jorge Quilcate Otoya <quilcate.jorge@gmail.com>
AuthorDate: Mon May 20 12:46:56 2019 +0200

    fix: use identifier on producer side only
---
 .../src/test/java/brave/kafka/clients/TracingConsumerTest.java    | 6 +++---
 .../src/main/java/brave/messaging/MessagingConsumerHandler.java   | 8 ++++----
 .../src/main/java/brave/messaging/MessagingConsumerParser.java    | 4 ++--
 .../src/main/java/brave/messaging/MessagingProducerParser.java    | 2 +-
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/instrumentation/kafka-clients/src/test/java/brave/kafka/clients/TracingConsumerTest.java
b/instrumentation/kafka-clients/src/test/java/brave/kafka/clients/TracingConsumerTest.java
index eeddddf..ce7e059 100644
--- a/instrumentation/kafka-clients/src/test/java/brave/kafka/clients/TracingConsumerTest.java
+++ b/instrumentation/kafka-clients/src/test/java/brave/kafka/clients/TracingConsumerTest.java
@@ -51,7 +51,7 @@ public class TracingConsumerTest extends BaseTracingTest {
     // tags are correct
     assertThat(spans)
         .flatExtracting(s -> s.tags().entrySet())
-        .containsOnly(entry("kafka.topic", "myTopic"), entry("kafka.key", TEST_KEY));
+        .containsOnly(entry("kafka.topic", "myTopic"));
   }
 
   @Test
@@ -76,7 +76,7 @@ public class TracingConsumerTest extends BaseTracingTest {
     // tags are correct
     assertThat(spans)
         .flatExtracting(s -> s.tags().entrySet())
-        .containsOnly(entry("kafka.topic", "myTopic"), entry("kafka.key", TEST_KEY));
+        .containsOnly(entry("kafka.topic", "myTopic"));
   }
 
   @Test
@@ -130,6 +130,6 @@ public class TracingConsumerTest extends BaseTracingTest {
     assertThat(spans)
         .hasSize(1)
         .flatExtracting(s -> s.tags().entrySet())
-        .containsOnly(entry("kafka.topic", "myTopic"), entry("kafka.key", TEST_KEY));
+        .containsOnly(entry("kafka.topic", "myTopic"));
   }
 }
diff --git a/instrumentation/messaging/src/main/java/brave/messaging/MessagingConsumerHandler.java
b/instrumentation/messaging/src/main/java/brave/messaging/MessagingConsumerHandler.java
index 4a3390d..65c54b3 100644
--- a/instrumentation/messaging/src/main/java/brave/messaging/MessagingConsumerHandler.java
+++ b/instrumentation/messaging/src/main/java/brave/messaging/MessagingConsumerHandler.java
@@ -43,15 +43,15 @@ public class MessagingConsumerHandler<C, Chan, Msg>
         parser.extractContextAndClearMessage(messageAdapter, extractor, message);
     Span result = tracing.tracer().nextSpan(extracted);
     if (extracted.context() == null && !result.isNoop()) {
-      addTags(channel, message, result);
+      addTags(channel, result);
     }
     return result;
   }
 
   /** When an upstream context was not present, lookup keys are unlikely added */
-  void addTags(Chan channel, Msg message, SpanCustomizer result) {
+  void addTags(Chan channel, SpanCustomizer result) {
     parser.channel(channelAdapter, channel, result);
-    parser.identifier(messageAdapter, message, result);
+    //parser.identifier(messageAdapter, message, result);
   }
 
   public void handleConsume(Chan channel, Msg message) {
@@ -59,7 +59,7 @@ public class MessagingConsumerHandler<C, Chan, Msg>
     // remove prior propagation headers from the message
     Span span = nextSpan(channel, message);
     if (!span.isNoop()) {
-      span.name(messageAdapter.operation(message)).kind(Span.Kind.CONSUMER);
+      span.kind(Span.Kind.CONSUMER);
       parser.message(channelAdapter, messageAdapter, channel, message, span);
 
       // incur timestamp overhead only once
diff --git a/instrumentation/messaging/src/main/java/brave/messaging/MessagingConsumerParser.java
b/instrumentation/messaging/src/main/java/brave/messaging/MessagingConsumerParser.java
index af1a2cb..7071bf2 100644
--- a/instrumentation/messaging/src/main/java/brave/messaging/MessagingConsumerParser.java
+++ b/instrumentation/messaging/src/main/java/brave/messaging/MessagingConsumerParser.java
@@ -11,7 +11,7 @@ public class MessagingConsumerParser extends MessagingParser {
       Chan channel, Msg message, SpanCustomizer customizer) {
     customizer.name(messageAdapter.operation(message));
     channel(channelAdapter, channel, customizer);
-    identifier(messageAdapter, message, customizer);
+    //identifier(messageAdapter, message, customizer);
   }
 
   public <Msg> TraceContextOrSamplingFlags extractContextAndClearMessage(
@@ -22,7 +22,7 @@ public class MessagingConsumerParser extends MessagingParser {
     // clear propagation headers if we were able to extract a span
     //TODO check if correct to not filter on empty flags. Diff between kafka and jms instrumentation
     //if (!extracted.equals(TraceContextOrSamplingFlags.EMPTY)) {
-      adapter.clearPropagation(message);
+    adapter.clearPropagation(message);
     //}
     return extracted;
   }
diff --git a/instrumentation/messaging/src/main/java/brave/messaging/MessagingProducerParser.java
b/instrumentation/messaging/src/main/java/brave/messaging/MessagingProducerParser.java
index b8180b6..79d843b 100644
--- a/instrumentation/messaging/src/main/java/brave/messaging/MessagingProducerParser.java
+++ b/instrumentation/messaging/src/main/java/brave/messaging/MessagingProducerParser.java
@@ -22,7 +22,7 @@ public class MessagingProducerParser extends MessagingParser {
     // clear propagation headers if we were able to extract a span
     //TODO check if correct to not filter on empty flags. Diff between kafka and jms instrumentation
     //if (!extracted.equals(TraceContextOrSamplingFlags.EMPTY)) {
-      adapter.clearPropagation(message);
+    adapter.clearPropagation(message);
     //}
     return extracted;
   }


Mime
View raw message