lilien1010 commented on a change in pull request #1386: enhance: plugin Zipkin
add service name and report local server IP
URL: https://github.com/apache/incubator-apisix/pull/1386#discussion_r402018378
##########
File path: apisix/plugins/zipkin.lua
##########
@@ -44,6 +55,11 @@ local _M = {
function _M.check_schema(conf)
+
+ if not conf.server_addr or conf.server_addr == '' then
+ conf.server_addr = ngx.var.server_addr
Review comment:
sure, how about move it into create_tracer function, like
```
local function create_tracer(conf)
if not conf.server_addr or conf.server_addr == '' then
conf.server_addr = ngx.var.server_addr
end
local tracer = new_tracer(new_reporter(conf), new_random_sampler(conf))
tracer:register_injector("http_headers", zipkin_codec.new_injector())
tracer:register_extractor("http_headers", zipkin_codec.new_extractor())
return tracer
end
```
----------------------------------------------------------------
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]
With regards,
Apache Git Services