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/06/05 02:25:02 UTC

[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #7070: polish debug logging avoid null value when segment be ignored.

kezhenxu94 commented on a change in pull request #7070:
URL: https://github.com/apache/skywalking/pull/7070#discussion_r645927919



##########
File path: oap-server/analyzer/agent-analyzer/src/main/java/org/apache/skywalking/oap/server/analyzer/provider/trace/parser/listener/SegmentAnalysisListener.java
##########
@@ -170,14 +170,17 @@ private void appendSearchableTags(SpanObject span) {
 
     @Override
     public void build() {
-        if (log.isDebugEnabled()) {
-            log.debug("segment listener build, segment id: {}", segment.getSegmentId());
-        }
-
         if (sampleStatus.equals(SAMPLE_STATUS.IGNORE)) {
+            if (log.isDebugEnabled()) {
+                log.debug("segment ignored, trace id: {}", segment.getTraceId());

Review comment:
       <img width="648" alt="Screen Shot 2021-06-05 at 10 18 19" src="https://user-images.githubusercontent.com/15965696/120877213-d82ee000-c5e7-11eb-9b43-f10f4984d1a3.png">
   
   This is because we defer the value of segment in `parseFirst`.
   
   I think we should review the `parse{First,Entry}` methods and move those span-unrelated logics into `parseSegment`, such as `segment.setSegmentId(segmentObject.getTraceSegmentId()`




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