From aa052aa02b39365d17fbe96957b33d50c1632c74 Mon Sep 17 00:00:00 2001 From: MoritzWeber Date: Wed, 9 Oct 2024 18:00:59 +0200 Subject: [PATCH] feat(grafana): Show user happiness over time --- helm/config/grafana/dashboards/feedback.json | 99 +++++++++++++++++++- 1 file changed, 98 insertions(+), 1 deletion(-) diff --git a/helm/config/grafana/dashboards/feedback.json b/helm/config/grafana/dashboards/feedback.json index 2032975c6d..380a7b6f82 100644 --- a/helm/config/grafana/dashboards/feedback.json +++ b/helm/config/grafana/dashboards/feedback.json @@ -377,6 +377,103 @@ } ], "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus_ccm" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-RdYlGr" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "max": 10, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 10, + "x": 0, + "y": 14 + }, + "id": 14, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus_ccm" + }, + "editorMode": "code", + "expr": "(sum(increase(feedback_count{rating=\"good\"}[$__range]) * 10) + sum(increase(feedback_count{rating=\"okay\"}[$__range]) * 5)) / sum(increase(feedback_count[$__range]))", + "instant": false, + "legendFormat": "User happiness index", + "range": true, + "refId": "A" + } + ], + "title": "User Happiness Index", + "type": "timeseries" } ], "refresh": "", @@ -393,6 +490,6 @@ "timezone": "", "title": "Feedback", "uid": "edzhg6sv97lz4c", - "version": 1, + "version": 2, "weekStart": "" }