First request always mapps as +inf bucket instead of real bucket
Veres72 opened this issue · 2 comments
The first request always maps as +inf bucket instead of real bucket, while all the following is correct.
The first request
nginx_vts_server_request_duration_seconds_bucket{host="_",le="0.001"} 0
nginx_vts_server_request_duration_seconds_bucket{host="_",le="1.000"} 0
nginx_vts_server_request_duration_seconds_bucket{host="_",le="100000.000"} 0
nginx_vts_server_request_duration_seconds_bucket{host="_",le="+Inf"} 1
nginx_vts_server_request_duration_seconds_sum{host="_"} 0.000
nginx_vts_server_request_duration_seconds_count{host="_"} 1
After several requests
nginx_vts_server_request_duration_seconds_bucket{host="_",le="0.001"} 11
nginx_vts_server_request_duration_seconds_bucket{host="_",le="1.000"} 11
nginx_vts_server_request_duration_seconds_bucket{host="_",le="100000.000"} 11
nginx_vts_server_request_duration_seconds_bucket{host="_",le="+Inf"} 12
nginx_vts_server_request_duration_seconds_sum{host="_"} 0.000
nginx_vts_server_request_duration_seconds_count{host="_"} 12
@Veres72
As you think, since nginx_vts_server_request_duration_seconds_sum
is zero, it should normally be calculated in the nginx_vts_server_request_duration_seconds_bucket{host="_",le="100000.000"}
part.
My guess is that it didn't count for some reason in the ngx_http_vhost_traffic_status_node_histogram_observe() function. I haven't succeeded in reproducing it. Please let me know the system environment where I can reproduce the problem as below.
1. Reproducible nginx settings
2. nginx informations displayed by executing the command "$ nginx -V"
3. nginx-module-vts version
Testing
nginx_vts_server_request_duration_seconds_bucket{host="_",le="0.001"} 1
nginx_vts_server_request_duration_seconds_bucket{host="_",le="1.000"} 1
nginx_vts_server_request_duration_seconds_bucket{host="_",le="100000.000"} 1
nginx_vts_server_request_duration_seconds_bucket{host="_",le="+Inf"} 1
nginx_vts_server_request_duration_seconds_sum{host="_"} 0.000
nginx_vts_server_request_duration_seconds_count{host="_"} 1
CallStack
#2 ngx_http_vhost_traffic_status_node_histogram_observe()
#1 ngx_http_vhost_traffic_status_node_update()
#0 ngx_http_vhost_traffic_status_node_init()
nginx-module-vts/src/ngx_http_vhost_traffic_status_node.c
Lines 607 to 621 in 8520fde
nginx-module-vts/src/ngx_http_vhost_traffic_status_node.c
Lines 376 to 401 in 8520fde
nginx-module-vts/src/ngx_http_vhost_traffic_status_node.c
Lines 322 to 346 in 8520fde
I updated from vts 0.1.18 to 0.2.1 and problem was solved. I will close the issue. Thank you.