feat: update skywalking componentId (#4060)

Co-authored-by: Yuelin Zheng <2226815922@qq.com>
Co-authored-by: zhuanghaochao <zhuanghaochao@yy.com>
This commit is contained in:
Daming 2021-04-16 17:25:51 +08:00 committed by GitHub
parent 0a8670041a
commit 77f8926d64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,6 +17,7 @@
local sw_tracer = require("skywalking.tracer")
local core = require("apisix.core")
local process = require("ngx.process")
local Span = require("skywalking.span")
local ngx = ngx
local math = math
local require = require
@ -90,6 +91,8 @@ end
function _M.body_filter(conf, ctx)
if ctx.skywalking_sample and ngx.arg[2] then
Span.setComponentId(ngx.ctx.exitSpan, 6002)
Span.setComponentId(ngx.ctx.entrySpan, 6002)
sw_tracer:finish()
core.log.info("tracer finish")
end