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/04/21 09:01:35 UTC

[GitHub] [skywalking-nginx-lua] wu-sheng commented on a diff in pull request #104: support to try to use request-id as trace-id when trace context absent

wu-sheng commented on code in PR #104:
URL: https://github.com/apache/skywalking-nginx-lua/pull/104#discussion_r854953333


##########
lib/skywalking/tracing_context.lua:
##########
@@ -109,14 +109,21 @@ function _M.newNoOP()
     return {is_noop = true}
 end
 
-function _M.new(serviceName, serviceInstanceName)
+function _M.new(serviceName, serviceInstanceName, requestId)
     if serviceInstanceName == nil or serviceName == nil then
         return _M.newNoOP()
     end
 
+    -- use request_id as trace_id if it is present
+    local trace_id = Util.newID()
+    local segment_id = trace_id
+    if requestId ~= nil then
+        trace_id = requestId
+    end

Review Comment:
   Why? If request ID exists, you are going to use request ID as trace id, then newID could be skipped.



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