Skip to content

Commit

Permalink
Fix sum of nginx process connections
Browse files Browse the repository at this point in the history
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".
  • Loading branch information
ml- authored and ml committed Nov 16, 2020
1 parent e975549 commit 29a1706
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deploy/grafana/dashboards/nginx.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 29a1706

Please sign in to comment.