lilien1010 commented on a change in pull request #1370: enhance: plugin Zipkin add service name and report local server IP URL: https://github.com/apache/incubator-apisix/pull/1370#discussion_r400074432
########## File path: lua/apisix/plugins/zipkin.lua ########## @@ -42,6 +47,20 @@ local _M = { schema = schema, } +local function excute_cmd(cmd) + local t, err = io.popen(cmd) + if not t then + return nil, "failed to execute command: " .. cmd .. ", error info:" .. err + end + local data = t:read("*all") + t:close() + return data +end + +local LOCAL_SERVER_IP,_ = excute_cmd("hostname -I | awk '{print $1}'") Review comment: changed into ctx.server_addr ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services