vozlt / nginx-module-vts

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

Duplicate metrics #200

Open dolgovas opened 3 years ago

dolgovas commented 3 years ago

Hello! We have some trouble with calculate global traffic...

nginx -V
nginx version: nginx/1.19.10
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
built with OpenSSL 1.1.1k  25 Mar 2021
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC' --add-module=/home/builder/rpm/SOURCES/ngx_brotli --with-openssl=/home/builder/rpm/SOURCES/openssl-1.1.1k --with-openssl-opt=enable-tls1_3 --add-module=/home/builder/rpm/SOURCES/ngx_devel_kit --add-module=/home/builder/rpm/SOURCES/ngx_http_geoip2_module --add-module=/home/builder/rpm/SOURCES/nginx-module-vts --add-module=/home/builder/rpm/SOURCES/nginx_upstream_check_module --add-module=/home/builder/rpm/SOURCES/testcookie-nginx-module --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie'
curl -s http://127.0.0.1:9913/metrics|grep 'nginx_vts_server_bytes_total{host="\*",direction="out"}'
nginx_vts_server_bytes_total{host="*",direction="out"} 0
nginx_vts_server_bytes_total{host="*",direction="out"} 68301879715485

I thought that we have multi master nginx...but not. Only one

# ps aux|grep nginx|grep master
root     13918  0.0  0.3 3627564 451656 ?      Ss   Apr17   3:59 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf

after restart nginx everything is ok...but it's return after few days

u5surf commented 1 year ago

Hi, @dolgovas We're sorry for the late response. I'm a new collaborator on this module. So I'd like to work on 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. 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.

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

dolgovas commented 1 year ago

Hello! Thank you for your answer. Here is module version that we are using now

module_version="0.1.19.dev.91bdb14", version="1.23.1

We meet that bug no so often...

When it comes again, I'll sent you some detailed info