spacewander commented on a change in pull request #5463:
URL: https://github.com/apache/apisix/pull/5463#discussion_r746292328
##########
File path: apisix/plugins/datadog.lua
##########
@@ -144,17 +141,22 @@ function _M.log(conf, ctx)
local entry = fetch_log(ngx, {})
entry.upstream_latency = ctx.var.upstream_response_time * 1000
entry.balancer_ip = ctx.balancer_ip or ""
- entry.route_name = ctx.route_name or ""
entry.scheme = ctx.upstream_scheme or ""
entry.prefer_name = conf.prefer_name
- -- capture service name at request response cycle if prefer_name is set.
- if entry.prefer_name and entry.service_id and entry.service_id ~= "" then
- local svc = service_fetch(entry.service_id)
+ -- if prefer_name is set, fetch the service/route name. If the name is
nil, fall back to id.
+ if entry.prefer_name then
Review comment:
We can use `conf.prefer_name` directly?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]