From a5b20a15164f22234be931f36776ac2b4f55bda8 Mon Sep 17 00:00:00 2001 From: Alexander Schwartz Date: Thu, 11 Apr 2024 10:39:57 +0200 Subject: [PATCH] Tuning the dashboard to have more information on the percentiles diagram, updating client credentials diagram --- .../dashboards/authentication-code.json | 6 +-- ...ials-otel.json => client-credentials.json} | 51 ++++++++++++++----- .../dashboards/client-credentials-otel.json | 1 - .../dashboards/client-credentials.json | 1 + 4 files changed, 42 insertions(+), 17 deletions(-) rename provision/minikube/monitoring/dashboards/{client-credentials-otel.json => client-credentials.json} (81%) delete mode 120000 provision/openshift/monitoring/dashboards/client-credentials-otel.json create mode 120000 provision/openshift/monitoring/dashboards/client-credentials.json diff --git a/provision/minikube/monitoring/dashboards/authentication-code.json b/provision/minikube/monitoring/dashboards/authentication-code.json index c642389f9..f29714e4a 100644 --- a/provision/minikube/monitoring/dashboards/authentication-code.json +++ b/provision/minikube/monitoring/dashboards/authentication-code.json @@ -351,7 +351,7 @@ "calcs": [], "displayMode": "list", "placement": "bottom", - "showLegend": false + "showLegend": true }, "tooltip": { "mode": "single", @@ -365,8 +365,8 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "histogram_quantile(0.99, sum(rate(http_server_requests_seconds_bucket{uri=~\"(/realms/{realm}/protocol/{protocol}/token|/realms/{realm}/protocol/{protocol}/auth|/realms/{realm}/protocol/{protocol}/logout|realms/{realm}/login-actions/authenticate)\", namespace=\"$namespace\", pod=\"$pod_name\"}[2m])) by (le,uri))", - "legendFormat": "__auto", + "expr": "histogram_quantile(0.99, sum(rate(http_server_requests_seconds_bucket{uri=~\"/realms/{realm}/protocol/{protocol}/(token|auth)|REDIRECTION|/realms/{realm}/login-actions/authenticate\", namespace=\"$namespace\", pod=\"$pod_name\"}[2m])) by (le,uri))", + "legendFormat": "{{uri}}", "range": true, "refId": "A" } diff --git a/provision/minikube/monitoring/dashboards/client-credentials-otel.json b/provision/minikube/monitoring/dashboards/client-credentials.json similarity index 81% rename from provision/minikube/monitoring/dashboards/client-credentials-otel.json rename to provision/minikube/monitoring/dashboards/client-credentials.json index a0607d8dc..c5f04f1ff 100644 --- a/provision/minikube/monitoring/dashboards/client-credentials-otel.json +++ b/provision/minikube/monitoring/dashboards/client-credentials.json @@ -53,6 +53,8 @@ "mode": "palette-classic" }, "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, @@ -131,7 +133,7 @@ }, "editorMode": "code", "exemplar": false, - "expr": "sum(rate(http_server_duration_seconds_bucket{http_route=\"/realms/{realm}/protocol/{protocol}/token\", le=\"0.05\", namespace=\"$namespace\", pod=\"$pod_name\"}[2m])) without (le) / rate(http_server_duration_count{http_route=\"/realms/{realm}/protocol/{protocol}/token\", namespace=\"$namespace\", pod=\"$pod_name\"}[2m])", + "expr": "sum(rate(http_server_requests_seconds_bucket{uri=\"/realms/{realm}/protocol/{protocol}/token\", le=\"0.05\", namespace=\"$namespace\", pod=\"$pod_name\"}[2m])) without (le) / rate(http_server_requests_seconds_count{uri=\"/realms/{realm}/protocol/{protocol}/token\", namespace=\"$namespace\", pod=\"$pod_name\"}[2m])", "format": "time_series", "hide": false, "instant": false, @@ -145,7 +147,7 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "rate(vendor_statistics_hits{cache=\"realms\", namespace=\"${namespace}\", pod=\"$pod_name\", job=\"${namespace}/keycloak-otel\"}[2m]) / (rate(vendor_statistics_hits{cache=\"realms\", namespace=\"${namespace}\", pod=\"$pod_name\", job=\"${namespace}/keycloak-otel\"}[2m]) + rate(vendor_statistics_misses{cache=\"realms\", namespace=\"${namespace}\", pod=\"$pod_name\", job=\"${namespace}/keycloak-otel\"}[2m]))", + "expr": "rate(vendor_statistics_hits{cache=\"realms\", namespace=\"${namespace}\", pod=\"$pod_name\"}[2m]) / (rate(vendor_statistics_hits{cache=\"realms\", namespace=\"${namespace}\", pod=\"$pod_name\"}[2m]) + rate(vendor_statistics_misses{cache=\"realms\", namespace=\"${namespace}\", pod=\"$pod_name\"}[2m]))", "hide": false, "legendFormat": "Realms cache hit ratio", "range": true, @@ -157,7 +159,7 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "rate(vendor_statistics_hits{cache=\"users\", namespace=\"${namespace}\", pod=\"$pod_name\", job=\"${namespace}/keycloak-otel\"}[2m]) / (rate(vendor_statistics_hits{cache=\"users\", namespace=\"${namespace}\", pod=\"$pod_name\", job=\"${namespace}/keycloak-otel\"}[2m]) + rate(vendor_statistics_misses{cache=\"users\", namespace=\"${namespace}\", pod=\"$pod_name\", job=\"${namespace}/keycloak-otel\"}[2m]))", + "expr": "rate(vendor_statistics_hits{cache=\"users\", namespace=\"${namespace}\", pod=\"$pod_name\"}[2m]) / (rate(vendor_statistics_hits{cache=\"users\", namespace=\"${namespace}\", pod=\"$pod_name\"}[2m]) + rate(vendor_statistics_misses{cache=\"users\", namespace=\"${namespace}\", pod=\"$pod_name\"}[2m]))", "hide": false, "legendFormat": "Users cache hit ratio", "range": true, @@ -181,6 +183,21 @@ "type": "prometheus", "uid": "PBFA97CFB590B2093" }, + "fieldConfig": { + "defaults": { + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "scaleDistribution": { + "type": "linear" + } + } + }, + "overrides": [] + }, "gridPos": { "h": 9, "w": 6, @@ -213,7 +230,8 @@ "le": 1e-9 }, "legend": { - "show": true + "show": true, + "showLegend": true }, "rowsFrame": { "layout": "auto" @@ -224,6 +242,7 @@ }, "yAxis": { "axisPlacement": "left", + "decimals": 3, "reverse": false } }, @@ -237,7 +256,7 @@ }, "editorMode": "code", "exemplar": true, - "expr": "sum by (le) (idelta(http_server_duration_seconds_bucket{http_route=\"/realms/{realm}/protocol/{protocol}/token\", namespace=\"$namespace\", pod=\"$pod_name\"} [2m]))", + "expr": "sum by (le) (idelta(http_server_requests_seconds_bucket{uri=\"/realms/{realm}/protocol/{protocol}/token\", namespace=\"$namespace\", pod=\"$pod_name\"} [2m]))", "format": "heatmap", "interval": "", "legendFormat": "{{le}}", @@ -272,6 +291,8 @@ "mode": "palette-classic" }, "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, @@ -329,7 +350,7 @@ "calcs": [], "displayMode": "list", "placement": "bottom", - "showLegend": false + "showLegend": true }, "tooltip": { "mode": "single", @@ -343,8 +364,8 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "histogram_quantile(0.99, sum(rate(http_server_duration_seconds_bucket{http_route=\"/realms/{realm}/protocol/{protocol}/token\", namespace=\"$namespace\", pod=\"$pod_name\"}[2m])) by (le))", - "legendFormat": "__auto", + "expr": "histogram_quantile(0.99, sum(rate(http_server_requests_seconds_bucket{uri=\"/realms/{realm}/protocol/{protocol}/token\", namespace=\"$namespace\", pod=\"$pod_name\"}[2m])) by (le,uri))", + "legendFormat": "{{uri}}", "range": true, "refId": "A" } @@ -355,7 +376,7 @@ ], "refresh": false, "revision": 1, - "schemaVersion": 36, + "schemaVersion": 38, "style": "dark", "tags": [], "templating": { @@ -363,8 +384,8 @@ { "current": { "selected": true, - "text": "keycloak", - "value": "keycloak" + "text": "runner-keycloak", + "value": "runner-keycloak" }, "datasource": { "type": "prometheus", @@ -396,14 +417,18 @@ "$__all" ] }, - "definition": "http_server_duration_seconds_count{namespace=\"$namespace\"}", + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "definition": "http_server_requests_seconds_bucket{namespace=\"$namespace\"}", "hide": 0, "includeAll": true, "multi": true, "name": "pod_name", "options": [], "query": { - "query": "http_server_duration_seconds_count{namespace=\"$namespace\"}", + "query": "http_server_requests_seconds_bucket{namespace=\"$namespace\"}", "refId": "StandardVariableQuery" }, "refresh": 2, diff --git a/provision/openshift/monitoring/dashboards/client-credentials-otel.json b/provision/openshift/monitoring/dashboards/client-credentials-otel.json deleted file mode 120000 index 90a5c44e3..000000000 --- a/provision/openshift/monitoring/dashboards/client-credentials-otel.json +++ /dev/null @@ -1 +0,0 @@ -../../../minikube/monitoring/dashboards/client-credentials-otel.json \ No newline at end of file diff --git a/provision/openshift/monitoring/dashboards/client-credentials.json b/provision/openshift/monitoring/dashboards/client-credentials.json new file mode 120000 index 000000000..1342c8977 --- /dev/null +++ b/provision/openshift/monitoring/dashboards/client-credentials.json @@ -0,0 +1 @@ +../../../minikube/monitoring/dashboards/client-credentials.json \ No newline at end of file