RGZingYang opened a new issue, #13698: URL: https://github.com/apache/apisix/issues/13698
### Current Behavior <img width="1908" height="146" alt="Image" src="https://github.com/user-attachments/assets/d149af33-7fc5-4827-9358-2523deae223f" /> The two metrics use different time units depending on upstream HTTP status: HTTP 200 responses: value in milliseconds Non-200 responses (4xx/5xx): value in seconds This inconsistency breaks monitoring dashboards, latency aggregation and alert rules, as we cannot apply unified conversion logic for latency statistics and SLA calculation. ### Expected Behavior _No response_ ### Error Logs _No response_ ### Steps to Reproduce -- Upstream responded — mark source before any early returns core.response.set_response_source(ctx, "upstream") if res.status == 429 or (res.status >= 500 and res.status < 600) then if res._t0 then apisix_upstream.update_upstream_state({ response_time = (ngx_now() - res._t0) * 1000, }) end if res._httpc then res._httpc:close() end return res.status end --------------------------------------------------- ctx.var.apisix_upstream_response_time and ctx.var.llm_time_to_first_token are not assigned values. ### Environment - APISIX version (run `apisix version`): 3.17 - Operating system (run `uname -a`): - OpenResty / Nginx version (run `openresty -V` or `nginx -V`): - etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`): - APISIX Dashboard version, if relevant: - Plugin runner version, for issues related to plugin runners: - LuaRocks version, for installation issues (run `luarocks --version`): -- 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]
