From 8eb18ec6512d53c71cc29fafc014be057bfa589b Mon Sep 17 00:00:00 2001 From: Viktor Barzin Date: Sat, 22 Mar 2025 15:46:17 +0000 Subject: [PATCH] add power and ups battery over time widgets to grafana [ci skip] --- .../kubernetes/monitoring/dashboards/ups.json | 201 ++++++++++++++++-- 1 file changed, 178 insertions(+), 23 deletions(-) diff --git a/modules/kubernetes/monitoring/dashboards/ups.json b/modules/kubernetes/monitoring/dashboards/ups.json index f48fb1b2..6e428bac 100644 --- a/modules/kubernetes/monitoring/dashboards/ups.json +++ b/modules/kubernetes/monitoring/dashboards/ups.json @@ -1261,46 +1261,92 @@ "type": "prometheus", "uid": "PBFA97CFB590B2093" }, + "description": "Battery Charge Remaining Expressed as a Percent of Full Charge", "fieldConfig": { "defaults": { "color": { - "mode": "thresholds" + "mode": "palette-classic" + }, + "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": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } }, "mappings": [], "thresholds": { - "mode": "percentage", + "mode": "absolute", "steps": [ { "color": "green", "value": null + }, + { + "color": "semi-dark-red", + "value": 5 + }, + { + "color": "semi-dark-orange", + "value": 20 + }, + { + "color": "#EAB839", + "value": 50 + }, + { + "color": "green", + "value": 90 } ] }, - "unit": "amp" + "unit": "percent" }, "overrides": [] }, "gridPos": { "h": 5, - "w": 3, - "x": 21, + "w": 12, + "x": 0, "y": 29 }, - "id": 4, + "id": 20, "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto" + "tooltip": { + "mode": "single", + "sort": "none" + } }, "pluginVersion": "11.1.0", "targets": [ @@ -1311,7 +1357,7 @@ }, "disableTextWrap": false, "editorMode": "builder", - "expr": "ups_upsBatteryCurrent / 1000000000", + "expr": "ups_upsEstimatedChargeRemaining", "fullMetaSearch": false, "includeNullMetadata": true, "instant": false, @@ -1321,8 +1367,117 @@ "useBackend": false } ], - "title": "Battery Current", - "type": "gauge" + "title": "Battery Remaining", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "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": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + }, + { + "color": "orange", + "value": 10 + }, + { + "color": "yellow", + "value": 30 + }, + { + "color": "green", + "value": 60 + } + ] + }, + "unit": "m" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 12, + "x": 12, + "y": 29 + }, + "id": 21, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.1.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "ups_upsEstimatedMinutesRemaining", + "fullMetaSearch": false, + "includeNullMetadata": true, + "instant": false, + "legendFormat": "__auto", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "Time Until Battery Depletion", + "type": "timeseries" } ], "refresh": "5s", @@ -1332,13 +1487,13 @@ "list": [] }, "time": { - "from": "now-1h", + "from": "now-2d", "to": "now" }, "timepicker": {}, "timezone": "browser", "title": "Huawei UPS 2000", "uid": "ee70yskqw5u68f", - "version": 16, + "version": 19, "weekStart": "" } \ No newline at end of file