nic-6443 opened a new issue #6301: URL: https://github.com/apache/apisix/issues/6301
### Issue description The APISIX prometheus plugin uses the `/nginx_status` endpoint provided by nginx to get some internal metrics, which return the data like ``` Active connections: 291 server accepts handled requests Reading: 6 Writing: 179 Waiting: 179 Reading: 6 Writing: 179 Waiting: 106 ``` According to the [nginx documentation](https://nginx.org/libxslt/en/docs/http/ngx_http_stub_status_module.html): > The following status information is provided: > > Active connections > The current number of active client connections including Waiting connections. > accepts > The total number of accepted client connections. > handled > The total number of handled connections. Generally, the parameter value is the same as accepts unless some resource limits have been reached (for example, the worker_connections limit). > requests > The total number of client requests. > Reading > The current number of connections where nginx is reading the request header. > Writing > The current number of connections where nginx is writing the response back to the client. > Waiting > The current number of idle client connections waiting for a request. The third number in the third line is `The total number of client requests`, but APISIX now puts this metric in `nginx_http_current_connections{label="total"}`, which is obviously wrong. Also the three metrics in the third line are all cumulative, should we use the counter type instead of the guage for those metrics? Which is more in line with the prometheus definition of metric types. So I want to introduce two new metric: 1. `nginx_http_requests_total`(counter type) 2. `nginx_http_connections_total`(counter type) with a `type` label, which has two values: `accepts`, `handled` ### Environment - apisix version (cmd: `apisix version`): 2.10.1 ### Steps to reproduce Just enable prometheus plugin. ### Actual result / ### Error log / ### Expected result _No response_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org