You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@skywalking.apache.org by wu...@apache.org on 2018/04/18 02:07:31 UTC

[incubator-skywalking] branch feature/trace-ui updated: Miss the segment name.

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch feature/trace-ui
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking.git


The following commit(s) were added to refs/heads/feature/trace-ui by this push:
     new b666394  Miss the segment name.
b666394 is described below

commit b6663947e46d975c6105a0680a978f1917a1a497
Author: wu-sheng <wu...@foxmail.com>
AuthorDate: Wed Apr 18 10:07:02 2018 +0800

    Miss the segment name.
---
 .../apm/collector/ui/service/TraceStackService.java           | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TraceStackService.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TraceStackService.java
index f462513..3b6f94e 100644
--- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TraceStackService.java
+++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/TraceStackService.java
@@ -29,6 +29,7 @@ import org.apache.skywalking.apm.collector.core.module.ModuleManager;
 import org.apache.skywalking.apm.collector.core.util.CollectionUtils;
 import org.apache.skywalking.apm.collector.core.util.Const;
 import org.apache.skywalking.apm.collector.core.util.ObjectUtils;
+import org.apache.skywalking.apm.collector.core.util.StringUtils;
 import org.apache.skywalking.apm.collector.storage.StorageModule;
 import org.apache.skywalking.apm.collector.storage.dao.ui.IGlobalTraceUIDAO;
 import org.apache.skywalking.apm.collector.storage.dao.ui.ISegmentUIDAO;
@@ -43,6 +44,7 @@ import org.apache.skywalking.apm.collector.storage.ui.trace.SegmentRef;
 import org.apache.skywalking.apm.collector.storage.ui.trace.Span;
 import org.apache.skywalking.apm.collector.storage.ui.trace.Trace;
 import org.apache.skywalking.apm.network.proto.SpanLayer;
+import org.apache.skywalking.apm.network.proto.SpanType;
 import org.apache.skywalking.apm.network.proto.TraceSegmentObject;
 import org.apache.skywalking.apm.network.proto.UniqueId;
 
@@ -100,6 +102,7 @@ public class TraceStackService {
                         if (span.getError()) {
                             segment.setError(true);
                         }
+
                         SpanLayer layer = spanObject.getSpanLayer();
                         switch (layer) {
                             case MQ:
@@ -142,6 +145,9 @@ public class TraceStackService {
                             }
                         }
                         span.setOperationName(operationName);
+                        if (SpanType.Entry.equals(spanObject.getSpanType())) {
+                            segment.setName(span.getOperationName());
+                        }
 
                         if (spanObject.getComponentId() == 0) {
                             span.setComponent(spanObject.getComponent());
@@ -206,6 +212,11 @@ public class TraceStackService {
                             span.getLogs().add(logEntity);
                         });
 
+                        if (span.getSpanId() == 0 && StringUtils.isEmpty(segment.getName())) {
+                            // If there is no entry span, use the first span operation as segment name.
+                            segment.setName(span.getOperationName());
+                        }
+
                         segment.addSpan(span);
                     });
 

-- 
To stop receiving notification emails like this one, please contact
wusheng@apache.org.