Update metrics logging

This commit updates the metrics.lua file in the src/common/core/metrics directory. The changes include:
- Replacing the 'date' field with the current system time using os.time()
- Updating the 'code' field to 'status' to match the ngx.status value
This commit is contained in:
Théophile Diot 2024-01-24 11:08:44 +01:00
parent 7b0e986d4a
commit 3dda5b19de
No known key found for this signature in database
GPG key ID: 248FEA4BAE400D06

View file

@ -50,12 +50,12 @@ function metrics:log()
end
end
local request = {
date = self.ctx.bw.local_time,
date = os.time(),
ip = self.ctx.bw.remote_addr,
country = country,
method = self.ctx.bw.request_method,
url = self.ctx.bw.request_uri,
code = ngx.status,
status = ngx.status,
["user-agent"] = self.ctx.bw.http_user_agent or "",
reason = reason,
data = data,