nginxinc/nginx-prometheus-exporter

Expose nginxplus_upstream_server_max_conns metric

byoda opened this issue · 3 comments

byoda commented

We have NGINX+ R24 running as API proxy. We implement the max_conns parameter for upstream servers, ie.

upstream <cluster> {
    zone  <cluster> 512k;
    server <server1-ip>:<port> max_conns=32;
    server <server2-ip>:<port> max_conns=32;
}

We have a grafana dashboard for the metric nginxplus_upstream_server_active but additionally need a metric telling us what the configured value for max_conns is, ie. nginxplus_upstream_server_max_conns. This would allow us to calculate the utilization ratio for the server in Grafana.

When looking at the NGINX+ API, this field is exposed in the API module under HTTP Upstream max_conns

byoda commented

Please review this PR implementing this feature.

In Grafana, we use the following formula to calculate a utilisation ratio for each application cluster that we reverse-proxy to:

topk(10, (sum by (upstream) (nginxplus_upstream_server_active{job="nginx"})  / sum by (upstream) (nginxplus_upstream_server_limit{job="nginx"})))

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

This issue was closed because it has been stalled for 7 days with no activity.