nginx-module-vts icon indicating copy to clipboard operation
nginx-module-vts copied to clipboard

precision of responseMsec

Open jingyuan66 opened this issue 1 year ago • 2 comments

Hello! The precision of responseMsec is too small, and the response time is too short, resulting in a response time of 0ms. Is there any way to change this?

image

jingyuan66 avatar Oct 22 '24 07:10 jingyuan66

@jingyuan66 Hi, Thanks submit the issue. Unfortunately the upstream responseMsec has been depended by nginx upstream module, its precision cannot change any way from this module. https://github.com/nginx/nginx/blob/f45c2707ea1bf6fde3bd0c045cc4a63cdc4a966a/src/http/ngx_http_upstream.c#L5796-L5804

u5surf avatar Oct 29 '24 23:10 u5surf

Thank you for the quick response and the information on the fixed precision of the nginx upstream module for response times. I also want to explore another way to obtain the response time data. I considering using following prometheus query: sum(rate(nginx_vts_upstream_response_seconds_total[1m])) by (backend) * 1000 / sum(rate(nginx_vts_upstream_requests_total[1m])) by (backend) this query calculates the average response time in milliseconds for each backend by summing the response times and dividing by request count over the past minute. Would this effectively provide the precision I need? Thank you again for your help!

jingyuan66 avatar Oct 30 '24 01:10 jingyuan66