From 29a170617f5bd24907365830665c5b0e8044b7e4 Mon Sep 17 00:00:00 2001 From: ml- Date: Mon, 16 Nov 2020 18:25:29 +0100 Subject: [PATCH] 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". --- deploy/grafana/dashboards/nginx.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/grafana/dashboards/nginx.json b/deploy/grafana/dashboards/nginx.json index 3641b844a..5369efb68 100644 --- a/deploy/grafana/dashboards/nginx.json +++ b/deploy/grafana/dashboards/nginx.json @@ -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,