vozlt / nginx-module-vts

Nginx virtual host traffic status module
BSD 2-Clause "Simplified" License
3.21k stars 459 forks source link

IPv4+IPv6 upstream: incorrect nginx_vts_upstream_request_seconds and nginx_vts_upstream_response_second #141

Open susuper opened 5 years ago

susuper commented 5 years ago

Hello. My upstream resolves both to IPv4 and IPv6 addresses. In this case nginx_vts_upstream_request_seconds and nginx_vts_upstream_response_seconds values doesn't match with Nginx access log data. Values of nginx_vts_upstream_request_seconds and nginx_vts_upstream_response_seconds are lower than data from access log ($request_time and $upstream_response_time) in ~20 times. Values of latest $request_time $upstream_response_time from access log: 0.110 0.110 0.158 0.159 0.152 0.151 0.134 0.134 0.112 0.111 nginx_vts_upstream_request_seconds and nginx_vts_upstream_response_second values are 0.006 and 0.006 almost all time. If I disable IPv6 on the server VTS data match data from access log. VTS config options are the following: vhost_traffic_status_zone;

jesson1 commented 1 year ago

Is there any way to solve this problem

u5surf commented 1 year ago

Hi, @jesson1 @susuper We're sorry for the late response. I'm a new collaborator on this module. At first, We'd like to reproduce this issue which active for a long time.

Can you answer a several questions for obtaining some cues about this issue?

  1. Can you check your module version? It can be found on your metrics response(json/prometheus) if you use the recent module like this.

    # HELP nginx_vts_info Nginx info
    # TYPE nginx_vts_info gauge
    nginx_vts_info{hostname="foobar",module_version="v0.2.1",version="1.23.1"} 1
  2. What nginx configration did you specify? In other word what is the result of this command?

    %  /usr/local/nginx/sbin/nginx -V
    nginx version: nginx/1.23.1
    configure arguments: --add-module=/home/u5surf/nginx-module-vts
  3. Is there any nginx.conf which it can be reproduced? We prefer to minimize it excluding your own business logics or nonrelated feature as possible.

  4. Does it still reproduce the latest module? If you can check the latest version, please confirm to reproduce.

jesson1 commented 1 year ago

Thank you. I found the data is accurate after testing