From f9c2846be9c597b402f5cabf355eb7bb60433066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tore=20Stendal=20L=C3=B8n=C3=B8y?= Date: Wed, 4 Sep 2024 21:45:18 +0200 Subject: [PATCH] fix: update dashboard to support namespace selection change will alter "Service Ingress" variable to "Ingress Namespace" and "Ingress". This better alligns with the variable selection found in the controller dashboard (nginx.json) --- .../request-handling-performance.json | 63 ++++++++++++++----- 1 file changed, 46 insertions(+), 17 deletions(-) diff --git a/deploy/grafana/dashboards/request-handling-performance.json b/deploy/grafana/dashboards/request-handling-performance.json index cde796384c..19311770d8 100644 --- a/deploy/grafana/dashboards/request-handling-performance.json +++ b/deploy/grafana/dashboards/request-handling-performance.json @@ -149,7 +149,7 @@ "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, - "expr": "histogram_quantile(\n 0.5,\n sum by (le)(\n rate(\n nginx_ingress_controller_request_duration_seconds_bucket{\n ingress =~ \"$ingress\"\n }[5m]\n )\n )\n)", + "expr": "histogram_quantile(\n 0.5,\n sum by (le)(\n rate(\n nginx_ingress_controller_request_duration_seconds_bucket{\n ingress =~ \"$ingress\",\nexported_namespace =~ \"$namespace\",\n status != \"101\"\n }[5m]\n )\n )\n)", "interval": "", "legendFormat": ".5", "refId": "D" @@ -159,7 +159,7 @@ "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, - "expr": "histogram_quantile(\n 0.95,\n sum by (le)(\n rate(\n nginx_ingress_controller_request_duration_seconds_bucket{\n ingress =~ \"$ingress\"\n }[5m]\n )\n )\n)", + "expr": "histogram_quantile(\n 0.95,\n sum by (le)(\n rate(\n nginx_ingress_controller_request_duration_seconds_bucket{\n ingress =~ \"$ingress\",\nexported_namespace =~ \"$namespace\",\n status != \"101\"\n }[5m]\n )\n )\n)", "interval": "", "legendFormat": ".95", "refId": "B" @@ -169,7 +169,7 @@ "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, - "expr": "histogram_quantile(\n 0.99,\n sum by (le)(\n rate(\n nginx_ingress_controller_request_duration_seconds_bucket{\n ingress =~ \"$ingress\"\n }[5m]\n )\n )\n)", + "expr": "histogram_quantile(\n 0.99,\n sum by (le)(\n rate(\n nginx_ingress_controller_request_duration_seconds_bucket{\n ingress =~ \"$ingress\",\nexported_namespace =~ \"$namespace\",\n status != \"101\"\n }[5m]\n )\n )\n)", "interval": "", "legendFormat": ".99", "refId": "A" @@ -266,7 +266,7 @@ "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, - "expr": "histogram_quantile(\n 0.5,\n sum by (le)(\n rate(\n nginx_ingress_controller_response_duration_seconds_bucket{\n ingress =~ \"$ingress\"\n }[5m]\n )\n )\n)", + "expr": "histogram_quantile(\n 0.5,\n sum by (le)(\n rate(\n nginx_ingress_controller_response_duration_seconds_bucket{\n ingress =~ \"$ingress\", exported_namespace =~ \"$namespace\",\n status != \"101\"\n }[5m]\n )\n )\n)", "instant": false, "interval": "", "intervalFactor": 1, @@ -278,7 +278,7 @@ "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, - "expr": "histogram_quantile(\n 0.95,\n sum by (le)(\n rate(\n nginx_ingress_controller_response_duration_seconds_bucket{\n ingress =~ \"$ingress\"\n }[5m]\n )\n )\n)", + "expr": "histogram_quantile(\n 0.95,\n sum by (le)(\n rate(\n nginx_ingress_controller_response_duration_seconds_bucket{\n ingress =~ \"$ingress\", exported_namespace =~ \"$namespace\",\n status != \"101\"\n }[5m]\n )\n )\n)", "interval": "", "legendFormat": ".95", "refId": "B" @@ -288,7 +288,7 @@ "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, - "expr": "histogram_quantile(\n 0.99,\n sum by (le)(\n rate(\n nginx_ingress_controller_response_duration_seconds_bucket{\n ingress =~ \"$ingress\"\n }[5m]\n )\n )\n)", + "expr": "histogram_quantile(\n 0.99,\n sum by (le)(\n rate(\n nginx_ingress_controller_response_duration_seconds_bucket{\n ingress =~ \"$ingress\", exported_namespace =~ \"$namespace\",\n status != \"101\"\n }[5m]\n )\n )\n)", "interval": "", "legendFormat": ".99", "refId": "A" @@ -384,7 +384,7 @@ "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, - "expr": " sum by (method, host, path)(\n rate(\n nginx_ingress_controller_request_duration_seconds_count{\n ingress =~ \"$ingress\"\n }[5m]\n )\n )\n", + "expr": " sum by (method, host, path)(\n rate(\n nginx_ingress_controller_request_duration_seconds_count{\n ingress =~ \"$ingress\", exported_namespace =~ \"$namespace\"\n }[5m]\n )\n )\n", "interval": "", "intervalFactor": 1, "legendFormat": "{{ method }} {{ host }}{{path }}", @@ -482,7 +482,7 @@ "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, - "expr": "histogram_quantile(\n .5,\n sum by (le, method, host, path)(\n rate(\n nginx_ingress_controller_response_duration_seconds_bucket{\n ingress =~ \"$ingress\"\n }[5m]\n )\n )\n)", + "expr": "histogram_quantile(\n .5,\n sum by (le, method, host, path)(\n rate(\n nginx_ingress_controller_response_duration_seconds_bucket{\n ingress =~ \"$ingress\", exported_namespace =~ \"$namespace\",\n status != \"101\"\n }[5m]\n )\n )\n)", "interval": "", "intervalFactor": 1, "legendFormat": "{{ method }} {{ host }}{{path }}", @@ -580,7 +580,7 @@ "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, - "expr": "sum by (method, host, path) (rate(nginx_ingress_controller_request_duration_seconds_count{\n ingress =~ \"$ingress\",\n status =~ \"[4-5].*\"\n}[5m])) / sum by (method, host, path) (rate(nginx_ingress_controller_request_duration_seconds_count{\n ingress =~ \"$ingress\",\n}[5m]))", + "expr": "sum by (method, host, path) (rate(nginx_ingress_controller_request_duration_seconds_count{\n ingress =~ \"$ingress\", exported_namespace =~ \"$namespace\",\n status =~ \"[4-5].*\"\n}[5m])) / sum by (method, host, path) (rate(nginx_ingress_controller_request_duration_seconds_count{\n ingress =~ \"$ingress\", exported_namespace =~ \"$namespace\"\n}[5m]))", "interval": "", "intervalFactor": 1, "legendFormat": "{{ method }} {{ host }}{{path }}", @@ -678,7 +678,7 @@ "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, - "expr": "sum by (method, host, path) (rate(nginx_ingress_controller_response_duration_seconds_sum{ingress =~ \"$ingress\"}[5m]))", + "expr": "sum by (method, host, path) (rate(nginx_ingress_controller_response_duration_seconds_sum{ingress =~ \"$ingress\", exported_namespace =~ \"$namespace\"}[5m]))", "interval": "", "intervalFactor": 1, "legendFormat": "{{ method }} {{ host }}{{path }}", @@ -775,7 +775,7 @@ "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, - "expr": " sum (\n rate(\n nginx_ingress_controller_request_duration_seconds_count{\n ingress =~ \"$ingress\",\n status =~\"[4-5].*\",\n }[5m]\n )\n ) by(method, host, path, status)\n", + "expr": " sum (\n rate(\n nginx_ingress_controller_request_duration_seconds_count{\n ingress =~ \"$ingress\",\nexported_namespace =~ \"$namespace\",\n status =~\"[4-5].*\",\n }[5m]\n )\n ) by(method, host, path, status)\n", "interval": "", "intervalFactor": 1, "legendFormat": "{{ method }} {{ host }}{{path }} {{ status }}", @@ -872,7 +872,7 @@ "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, - "expr": "sum (\n rate (\n nginx_ingress_controller_response_size_sum {\n ingress =~ \"$ingress\",\n }[5m]\n )\n) by (method, host, path) / sum (\n rate(\n nginx_ingress_controller_response_size_count {\n ingress =~ \"$ingress\",\n }[5m]\n )\n) by (method, host, path)\n", + "expr": "sum (\n rate (\n nginx_ingress_controller_response_size_sum {\n ingress =~ \"$ingress\",\nexported_namespace =~ \"$namespace\"\n }[5m]\n )\n) by (method, host, path) / sum (\n rate(\n nginx_ingress_controller_response_size_count {\n ingress =~ \"$ingress\",\nexported_namespace =~ \"$namespace\"\n }[5m]\n )\n) by (method, host, path)\n", "hide": false, "instant": false, "interval": "", @@ -885,7 +885,7 @@ "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, - "expr": " sum (rate(nginx_ingress_controller_response_size_bucket{\n ingress =~ \"$ingress\",\n }[5m])) by (le)\n", + "expr": " sum (rate(nginx_ingress_controller_response_size_bucket{\n ingress =~ \"$ingress\",\nexported_namespace =~ \"$namespace\"\n }[5m])) by (le)\n", "hide": true, "legendFormat": "{{le}}", "refId": "A" @@ -927,16 +927,45 @@ "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, - "definition": "label_values(nginx_ingress_controller_requests, ingress) ", + "definition": "label_values(nginx_ingress_controller_requests,exported_namespace)", "hide": 0, "includeAll": true, - "label": "Service Ingress", + "label": "Ingress Namespace", + "multi": false, + "name": "namespace", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(nginx_ingress_controller_requests,exported_namespace)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 2, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": ".*", + "current": {}, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "definition": "label_values(nginx_ingress_controller_requests{exported_namespace=~\"$namespace\"},ingress)", + "hide": 0, + "includeAll": true, + "label": "Ingress", "multi": false, "name": "ingress", "options": [], "query": { - "query": "label_values(nginx_ingress_controller_requests, ingress) ", - "refId": "Prometheus-ingress-Variable-Query" + "qryType": 1, + "query": "label_values(nginx_ingress_controller_requests{exported_namespace=~\"$namespace\"},ingress)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" }, "refresh": 1, "regex": "",