From 0c2eb32318771875f0b73e2e705c1c113b462f04 Mon Sep 17 00:00:00 2001 From: Ricardo Ribeiro Date: Tue, 2 May 2023 13:28:17 +0100 Subject: [PATCH] fix(config/grafana): use range for HPA metrics Use range instead of instant for HPA current/max replicas (time based). Right now, we are using the instant selector, which given that the panel should be time-based (as per the title), it should use a range selector, thus getting all metrics in a given timeframe. Also, moved from bars to lines because bars are hard to visualize using ranges containing several days worth of data. Signed-off-by: Ricardo Ribeiro --- CHANGELOG.md | 1 + config/grafana/keda-dashboard.json | 22 ++++++++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a76a2170aba..b39dab8aa03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,7 @@ To learn more about active deprecations, we recommend checking [GitHub Discussio - **Azure Pipelines**: Fix for disallowing `$top` on query when using `meta.parentID` method ([#4397]) - **Azure Pipelines**: Respect all required demands ([#4404](https://github.com/kedacore/keda/issues/4404)) - **Prometheus Metrics**: Create e2e tests for all exposed Prometheus metrics ([#4127](https://github.com/kedacore/keda/issues/4127)) +- **Grafana Dashboard**: Fix HPA metrics panel to use range instead of instant ([#4513](https://github.com/kedacore/keda/pull/4513)) ### Deprecations diff --git a/config/grafana/keda-dashboard.json b/config/grafana/keda-dashboard.json index 966d2772823..764374d0be3 100644 --- a/config/grafana/keda-dashboard.json +++ b/config/grafana/keda-dashboard.json @@ -735,18 +735,23 @@ "mode": "palette-classic" }, "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, - "drawStyle": "bars", + "drawStyle": "line", "fillOpacity": 100, - "gradientMode": "hue", + "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", + "lineStyle": { + "fill": "solid" + }, "lineWidth": 1, "pointSize": 5, "scaleDistribution": { @@ -756,7 +761,7 @@ "spanNulls": false, "stacking": { "group": "A", - "mode": "normal" + "mode": "none" }, "thresholdsStyle": { "mode": "off" @@ -787,7 +792,8 @@ "legend": { "calcs": [], "displayMode": "list", - "placement": "bottom" + "placement": "bottom", + "showLegend": true }, "tooltip": { "mode": "single", @@ -804,10 +810,10 @@ "exemplar": false, "expr": "kube_horizontalpodautoscaler_status_current_replicas{namespace=\"$namespace\",horizontalpodautoscaler=\"keda-hpa-$scaledObject\"}", "format": "time_series", - "instant": true, + "instant": false, "interval": "", "legendFormat": "current_replicas", - "range": false, + "range": true, "refId": "A" }, { @@ -820,9 +826,9 @@ "expr": "kube_horizontalpodautoscaler_spec_max_replicas{namespace=\"$namespace\",horizontalpodautoscaler=\"keda-hpa-$scaledObject\"}", "format": "time_series", "hide": false, - "instant": true, + "instant": false, "legendFormat": "max_replicas", - "range": false, + "range": true, "refId": "B" } ],