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 2021/01/12 09:13:10 UTC

[GitHub] [skywalking] bestpayAmes opened a new issue #6186: the first segment of a trace should be tageed ?

bestpayAmes opened a new issue #6186:
URL: https://github.com/apache/skywalking/issues/6186


   ### Question
   - the first segment of a trace is should tageed? because when querying trace ,we transfer a traceId ,but return is all segment list, this is not reasonable?
   
   


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



[GitHub] [skywalking] wu-sheng commented on issue #6186: the first segment of a trace should be tageed ?

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #6186:
URL: https://github.com/apache/skywalking/issues/6186#issuecomment-758521504


   That query is query segments, which composing the trace. We explained it in the UI doc already.


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



[GitHub] [skywalking] bestpayAmes commented on issue #6186: the first segment of a trace should be tageed ?

Posted by GitBox <gi...@apache.org>.
bestpayAmes commented on issue #6186:
URL: https://github.com/apache/skywalking/issues/6186#issuecomment-760070323


   `private List<Span> findRoot(List<Span> spans) {
           List<Span> rootSpans = new ArrayList<>();
           spans.forEach(span -> {
               String segmentParentSpanId = span.getSegmentParentSpanId();
   
               boolean hasParent = false;
               for (Span subSpan : spans) {
                   if (segmentParentSpanId.equals(subSpan.getSegmentSpanId())) {
                       hasParent = true;
                       // if find parent, quick exit
                       break;
                   }
               }
   
               if (!hasParent) {
                   span.setRoot(true);
                   rootSpans.add(span);
               }
           });`
   because of it,This code is inefficient,O(N^2)


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



[GitHub] [skywalking] wu-sheng closed issue #6186: the first segment of a trace should be tageed ?

Posted by GitBox <gi...@apache.org>.
wu-sheng closed issue #6186:
URL: https://github.com/apache/skywalking/issues/6186


   


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