dmsolr commented on code in PR #104:
URL:
https://github.com/apache/skywalking-nginx-lua/pull/104#discussion_r855051043
##########
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:
emmm. the code is a bad readablity.
i means, trace id is from request id. but the segment id still has to
generate a new one.
i invoke the newID to generate an id for trace id and segment id at same
time.
the request id cannot be segment id because the segment id conflicts when
the upstream is nginx.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]