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 2022/11/01 08:27:32 UTC

[GitHub] [skywalking] wu-sheng commented on a diff in pull request #9855: Add virtual MQ analysis for native traces

wu-sheng commented on code in PR #9855:
URL: https://github.com/apache/skywalking/pull/9855#discussion_r1010200088


##########
oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/vservice/VirtualMQProcessor.java:
##########
@@ -51,17 +52,25 @@ public void prepareVSIfNecessary(final SpanObject span, final SegmentObject segm
             return;
         }
         MQTags mqTags = collectTags(span.getTagsList());
-        if (StringUtil.isBlank(mqTags.broker)) {
-            return;
+        final MQOperation mqOperation;
+        final String serviceName;
+        if (span.getSpanType() == SpanType.Entry) {
+            mqOperation = MQOperation.Consume;
+            final String peer = span.getRefsList()
+                                    .stream()
+                                    .findFirst()
+                                    .map(SegmentReference::getNetworkAddressUsedAtPeer)
+                                    .orElse(null);
+            serviceName = namingControl.formatServiceName(peer);
+        } else {

Review Comment:
   Should we have an `else if` here?



-- 
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