zipkin-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] [incubator-zipkin-brave] adriancole commented on a change in pull request #904: Messaging adapter
Date Mon, 20 May 2019 13:38:20 GMT
adriancole commented on a change in pull request #904: Messaging adapter

 File path: instrumentation/messaging/src/main/java/brave/messaging/
 @@ -0,0 +1,43 @@
+package brave.messaging;
+import brave.SpanCustomizer;
+import brave.propagation.TraceContext;
+import brave.propagation.TraceContextOrSamplingFlags;
+public class MessagingParser {
+  public <Chan, Msg> void message(ChannelAdapter<Chan> channelAdapter,
+      MessageAdapter<Msg> messageAdapter,
+      Chan channel, Msg message, SpanCustomizer customizer) {
+    channel(channelAdapter, channel, customizer);
+    identifier(messageAdapter, message, customizer);
+  }
+  public <Chan> void channel(ChannelAdapter<Chan> adapter, Chan chan,
+      SpanCustomizer customizer) {
+    String channel =;
+    if (chan != null) customizer.tag(adapter.channelTagKey(chan), channel);
+  }
+  public <Msg> void identifier(MessageAdapter<Msg> adapter, Msg message,
+      SpanCustomizer customizer) {
+    String identifier = adapter.identifier(message);
+    if (identifier != null) {
 Review comment:
   my 2p is that the type of identifier should be its own value. for example, if it is important
that the type is correlation id. "message.idenifier_type=correlation" In this way, FinishedSpanHandler
can choose to take whatever the identifier is without having to first see what the key could
be.. for example, it might never know the name of the key returned here. Stable keys can help
with portable data policy iotw

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:

With regards,
Apache Git Services

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message