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/16 06:07:25 UTC

[GitHub] [skywalking] wu-sheng commented on a change in pull request #6216: change spanId toolkit api type

wu-sheng commented on a change in pull request #6216:
URL: https://github.com/apache/skywalking/pull/6216#discussion_r558813205



##########
File path: apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/ContextManager.java
##########
@@ -70,27 +70,27 @@ private static AbstractTracerContext get() {
     }
 
     /**
-     * @return the first global trace id if needEnhance. Otherwise, "N/A".
+     * @return the first global trace id when tracing. Otherwise, "N/A".
      */
     public static String getGlobalTraceId() {
         AbstractTracerContext context = CONTEXT.get();
         return Objects.nonNull(context) ? context.getReadablePrimaryTraceId() : EMPTY_TRACE_CONTEXT_ID;
     }
 
     /**
-     * @return the current segment id if needEnhance. Otherwise, "N/A".
+     * @return the current segment id when tracing. Otherwise, "N/A".
      */
     public static String getSegmentId() {
         AbstractTracerContext context = CONTEXT.get();
         return Objects.nonNull(context) ? context.getSegmentId() : EMPTY_TRACE_CONTEXT_ID;
     }
 
     /**
-     * @return the current span id if needEnhance. Otherwise, "N/A".
+     * @return the current span id when tracing. Otherwise, the value is -1.
      */
-    public static String getSpanId() {
+    public static Integer getSpanId() {

Review comment:
       The integer makes me feel, if not tracing, should null?
   -1 makes sense if the return type is int.




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