wu-sheng commented on a change in pull request #42:
URL: 
https://github.com/apache/skywalking-nginx-lua/pull/42#discussion_r495822580



##########
File path: lib/skywalking/tracer.lua
##########
@@ -77,7 +81,11 @@ function Tracer:prepareForReport()
     local TC = require('tracing_context')
     local Segment = require('segment')
     if ngx.ctx.entrySpan ~= nil then
-        Span.tag(ngx.ctx.entrySpan, 'http.status', ngx.var.status)
+        local ngxstatus = ngx.var.status
+        Span.tag(ngx.ctx.entrySpan, 'http.status', ngxstatus)
+        if tonumber(ngxstatus) >= 500 then
+           Span.errorOccurred(ngx.ctx.entrySpan)
+        end

Review comment:
       Why do this again in the reporting stage? I think all logic should be 
included in `Tracer:finish`. Could you explain?




----------------------------------------------------------------
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:
[email protected]


Reply via email to