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 2020/09/29 03:16:41 UTC

[GitHub] [skywalking-nginx-lua] Jijun commented on a change in pull request #42: add error check, status code great or equal than 500 would be in erro…

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



##########
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:
       i follow the origin author's logic and made minimal changes as far as possible.




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