Fix sum of nginx process connections

nginx_ingress_controller_nginx_process_connections returns four elements
for each pod, one for each "state" (active, reading, waiting, writing).

The value of the element with state "active" is the sum of the other
three elements of other states:

active = reading + waiting + writing

So sum() returns a value that is 2x of the actual amount of connections.
To fix this we simply select elements with state "active".
This commit is contained in:
ml- 2020-11-16 18:25:29 +01:00 committed by ml
parent e9755496a3
commit 29a170617f

View file

@ -206,7 +206,7 @@
"tableColumn": "",
"targets": [
{
"expr": "sum(avg_over_time(nginx_ingress_controller_nginx_process_connections{controller_pod=~\"$controller\",controller_class=~\"$controller_class\",controller_namespace=~\"$namespace\"}[2m]))",
"expr": "sum(avg_over_time(nginx_ingress_controller_nginx_process_connections{controller_pod=~\"$controller\",controller_class=~\"$controller_class\",controller_namespace=~\"$namespace\",state=\"active\"}[2m]))",
"format": "time_series",
"instant": false,
"intervalFactor": 1,