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

nginx_vts_server_request_seconds is always 0.000

Open efotopoulou opened this issue 5 years ago • 1 comments

I enabled the nginx-module-vts and succesfully got the custom metrics at a prometheus format as seen below. Screenshot_20201021_171918

I also placed a cpu intensive index.html where each request takes at least 1 second to get served.

<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>

<p><em>Thank you for using nginx.</em></p>
<p id="demo"></p>

<script>
function mySlowFunction(baseNumber) {
	console.time('mySlowFunction');
	let result = 0;	
	for (var i = Math.pow(baseNumber, 7); i >= 0; i--) {		
		result += Math.atan(i) * Math.tan(i);
	};
	console.timeEnd('mySlowFunction');
	return result;
}
document.getElementById("demo").innerHTML = mySlowFunction(11);

</script>
</body>
</html>

My problem is that the nginx_vts_server_request_seconds metric is always 0.000 so i can not fetch the time my requests need to get succesfully served.

Any help would be more than welcome since i really need to calculate the latency of my http requests.

Thanks in advanced!

efotopoulou avatar Oct 21 '20 14:10 efotopoulou

I'm experiencing this as well

Wyfy0107 avatar Jul 25 '22 13:07 Wyfy0107

It's not the script execution latency, it's the http content's download completion time.

vozlt avatar Sep 04 '22 16:09 vozlt