in lib/skywalking/tracer.lua [101:112]
function Tracer:finish()
if ngx.ctx.exitSpan ~= nil and not ngx.ctx.is_finished then
local upstream_status = tonumber(ngx.var.upstream_status)
if upstream_status then
Span.tag(ngx.ctx.exitSpan, 'http.status', upstream_status)
end
Span.finish(ngx.ctx.exitSpan, ngx.now() * 1000)
ngx.ctx.exitSpan = nil
ngx.ctx.is_finished = true
end
end