From 7d3b12c77460d17a095f117e63221b2668bf855d Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Sun, 12 Apr 2026 19:56:12 -0300 Subject: [PATCH] monitoring: restore stat layout for ups/climate/fan rows --- scripts/dashboards_render_atlas.py | 111 ++++++---- .../monitoring/dashboards/atlas-overview.json | 194 +++++++++++------- .../monitoring/dashboards/atlas-power.json | 193 ++++++++++------- .../grafana-dashboard-overview.yaml | 194 +++++++++++------- .../monitoring/grafana-dashboard-power.yaml | 193 ++++++++++------- 5 files changed, 541 insertions(+), 344 deletions(-) diff --git a/scripts/dashboards_render_atlas.py b/scripts/dashboards_render_atlas.py index 6ea0cb62..595fcf7c 100644 --- a/scripts/dashboards_render_atlas.py +++ b/scripts/dashboards_render_atlas.py @@ -1397,23 +1397,25 @@ def build_overview(): ] panels.append( - table_panel( + stat_panel( 40, "UPS Current Load", UPS_CURRENT_ROW_EXPR, {"h": 5, "w": 6, "x": 0, "y": 7}, + unit="none", + decimals=1, + text_mode="name_and_value", + legend="{{ups}} {{metric}}", instant=True, - transformations=[ - {"id": "labelsToFields", "options": {"mode": "columns", "valueLabel": "metric"}}, - {"id": "organize", "options": {"excludeByName": {"Time": True}}}, - ], field_overrides=[ - {"matcher": {"id": "byName", "options": "Draw (W)"}, "properties": [{"id": "unit", "value": "watt"}]}, - {"matcher": {"id": "byName", "options": "Discharge"}, "properties": [{"id": "unit", "value": "s"}]}, - {"matcher": {"id": "byName", "options": "Status"}, "properties": [{"id": "mappings", "value": status_mapping}]}, + {"matcher": {"id": "byRegexp", "options": ".*Draw \\(W\\)$"}, "properties": [{"id": "unit", "value": "watt"}]}, + {"matcher": {"id": "byRegexp", "options": ".*Discharge$"}, "properties": [{"id": "unit", "value": "s"}]}, + {"matcher": {"id": "byRegexp", "options": ".*Status$"}, "properties": [{"id": "mappings", "value": status_mapping}]}, ], links=link_to("atlas-power"), - description="Per-UPS two-row snapshot: draw (W), discharge runtime, and status.", + description="Per-UPS live snapshot: draw, discharge runtime, and status.", + orientation="horizontal", + wide_layout=False, ) ) panels.append( @@ -1434,16 +1436,16 @@ def build_overview(): ) ) panels.append( - table_panel( + stat_panel( 42, "Current Climate", CLIMATE_CURRENT_ROW_EXPR, {"h": 6, "w": 6, "x": 0, "y": 12}, + unit="none", + decimals=2, + text_mode="name_and_value", + legend="{{metric}}", instant=True, - transformations=[ - {"id": "labelsToFields", "options": {"mode": "columns", "valueLabel": "metric"}}, - {"id": "organize", "options": {"excludeByName": {"Time": True}}}, - ], field_overrides=[ {"matcher": {"id": "byName", "options": "Temp °C"}, "properties": [{"id": "unit", "value": "celsius"}]}, {"matcher": {"id": "byName", "options": "Temp °F"}, "properties": [{"id": "unit", "value": "fahrenheit"}]}, @@ -1451,7 +1453,9 @@ def build_overview(): {"matcher": {"id": "byName", "options": "Pressure"}, "properties": [{"id": "unit", "value": "suffix:kPa"}]}, ], links=link_to("atlas-power"), - description="Single-row climate snapshot: Temp °C, Temp °F, Humidity, Pressure.", + description="Current tent values: Temp °C, Temp °F, Humidity, Pressure.", + orientation="horizontal", + wide_layout=False, ) ) panels.append( @@ -1490,16 +1494,24 @@ def build_overview(): ) ) panels.append( - table_panel( + stat_panel( 140, "Fan Activity", CLIMATE_FAN_CURRENT_ROW_EXPR, {"h": 6, "w": 6, "x": 12, "y": 12}, + unit="none", + decimals=0, + text_mode="name_and_value", + legend="{{metric}}", instant=True, - transformations=[ - {"id": "labelsToFields", "options": {"mode": "columns", "valueLabel": "metric"}}, - {"id": "organize", "options": {"excludeByName": {"Time": True}}}, - ], + thresholds={ + "mode": "absolute", + "steps": [ + {"color": "green", "value": None}, + {"color": "yellow", "value": 7}, + {"color": "red", "value": 9}, + ], + }, field_overrides=[ {"matcher": {"id": "byName", "options": "Outlet"}, "properties": [{"id": "decimals", "value": 0}]}, {"matcher": {"id": "byName", "options": "Inlet In"}, "properties": [{"id": "decimals", "value": 0}]}, @@ -1507,7 +1519,8 @@ def build_overview(): {"matcher": {"id": "byName", "options": "Interior"}, "properties": [{"id": "decimals", "value": 0}]}, ], links=link_to("atlas-power"), - description="Single-row fan snapshot: outlet, inlet in, inlet out, interior (0-10).", + orientation="horizontal", + wide_layout=False, ) ) panels.append( @@ -3253,23 +3266,25 @@ def build_power_dashboard(): ] panels.append( - table_panel( + stat_panel( 1, "UPS Current Load", UPS_CURRENT_ROW_EXPR, {"h": 8, "w": 12, "x": 0, "y": 0}, + unit="none", + decimals=1, + text_mode="name_and_value", + legend="{{ups}} {{metric}}", instant=True, - transformations=[ - {"id": "labelsToFields", "options": {"mode": "columns", "valueLabel": "metric"}}, - {"id": "organize", "options": {"excludeByName": {"Time": True}}}, - ], field_overrides=[ - {"matcher": {"id": "byName", "options": "Draw (W)"}, "properties": [{"id": "unit", "value": "watt"}]}, - {"matcher": {"id": "byName", "options": "Discharge"}, "properties": [{"id": "unit", "value": "s"}]}, - {"matcher": {"id": "byName", "options": "Status"}, "properties": [{"id": "mappings", "value": status_mapping}]}, + {"matcher": {"id": "byRegexp", "options": ".*Draw \\(W\\)$"}, "properties": [{"id": "unit", "value": "watt"}]}, + {"matcher": {"id": "byRegexp", "options": ".*Discharge$"}, "properties": [{"id": "unit", "value": "s"}]}, + {"matcher": {"id": "byRegexp", "options": ".*Status$"}, "properties": [{"id": "mappings", "value": status_mapping}]}, ], + orientation="horizontal", + wide_layout=False, description=( - "Per-UPS two-row snapshot: draw (W), discharge runtime, and charging/discharging status." + "Per-UPS live snapshot: draw, discharge runtime, and charging/discharging status." ), ) ) @@ -3291,23 +3306,25 @@ def build_power_dashboard(): ) ) panels.append( - table_panel( + stat_panel( 3, "Current Climate", CLIMATE_CURRENT_ROW_EXPR, {"h": 8, "w": 12, "x": 0, "y": 8}, + unit="none", + decimals=2, + text_mode="name_and_value", + legend="{{metric}}", instant=True, - transformations=[ - {"id": "labelsToFields", "options": {"mode": "columns", "valueLabel": "metric"}}, - {"id": "organize", "options": {"excludeByName": {"Time": True}}}, - ], field_overrides=[ {"matcher": {"id": "byName", "options": "Temp °C"}, "properties": [{"id": "unit", "value": "celsius"}]}, {"matcher": {"id": "byName", "options": "Temp °F"}, "properties": [{"id": "unit", "value": "fahrenheit"}]}, {"matcher": {"id": "byName", "options": "Humidity"}, "properties": [{"id": "unit", "value": "percent"}]}, {"matcher": {"id": "byName", "options": "Pressure"}, "properties": [{"id": "unit", "value": "suffix:kPa"}]}, ], - description="Single-row climate snapshot: Temp °C, Temp °F, Humidity, Pressure.", + orientation="horizontal", + wide_layout=False, + description="Current tent values: Temp °C, Temp °F, Humidity, Pressure.", ) ) panels.append( @@ -3352,23 +3369,33 @@ def build_power_dashboard(): ) ) panels.append( - table_panel( + stat_panel( 5, "Fan Activity", CLIMATE_FAN_CURRENT_ROW_EXPR, {"h": 8, "w": 12, "x": 0, "y": 16}, + unit="none", + decimals=0, + text_mode="name_and_value", + legend="{{metric}}", instant=True, - transformations=[ - {"id": "labelsToFields", "options": {"mode": "columns", "valueLabel": "metric"}}, - {"id": "organize", "options": {"excludeByName": {"Time": True}}}, - ], + thresholds={ + "mode": "absolute", + "steps": [ + {"color": "green", "value": None}, + {"color": "yellow", "value": 7}, + {"color": "red", "value": 9}, + ], + }, field_overrides=[ {"matcher": {"id": "byName", "options": "Outlet"}, "properties": [{"id": "decimals", "value": 0}]}, {"matcher": {"id": "byName", "options": "Inlet In"}, "properties": [{"id": "decimals", "value": 0}]}, {"matcher": {"id": "byName", "options": "Inlet Out"}, "properties": [{"id": "decimals", "value": 0}]}, {"matcher": {"id": "byName", "options": "Interior"}, "properties": [{"id": "decimals", "value": 0}]}, ], - description="Single-row fan snapshot: outlet, inlet in, inlet out, interior (0-10).", + orientation="horizontal", + wide_layout=False, + description="Current fan activity levels: outlet, inlet in, inlet out, interior (0-10).", ) ) panels.append( diff --git a/services/monitoring/dashboards/atlas-overview.json b/services/monitoring/dashboards/atlas-overview.json index f540bc07..396ab361 100644 --- a/services/monitoring/dashboards/atlas-overview.json +++ b/services/monitoring/dashboards/atlas-overview.json @@ -1072,7 +1072,7 @@ }, { "id": 40, - "type": "table", + "type": "stat", "title": "UPS Current Load", "datasource": { "type": "prometheus", @@ -1088,21 +1088,40 @@ { "expr": "label_replace(label_replace((max((ananke_ups_load_percent{job=\"ananke-power\",source=\"Pyrphoros\"} * ananke_ups_power_nominal_watts{job=\"ananke-power\",source=\"Pyrphoros\"}) / 100) or on() vector(0)), \"ups\", \"Pyrphoros\", \"__name__\", \".*\"), \"metric\", \"Draw (W)\", \"__name__\", \".*\") or label_replace(label_replace((max(ananke_ups_runtime_seconds{job=\"ananke-power\",source=\"Pyrphoros\"}) or on() vector(0)), \"ups\", \"Pyrphoros\", \"__name__\", \".*\"), \"metric\", \"Discharge\", \"__name__\", \".*\") or label_replace(label_replace((max(ananke_ups_on_battery{job=\"ananke-power\",source=\"Pyrphoros\"}) or on() vector(0)), \"ups\", \"Pyrphoros\", \"__name__\", \".*\"), \"metric\", \"Status\", \"__name__\", \".*\") or label_replace(label_replace((max((ananke_ups_load_percent{job=\"ananke-power\",source=\"Statera\"} * ananke_ups_power_nominal_watts{job=\"ananke-power\",source=\"Statera\"}) / 100) or on() vector(0)), \"ups\", \"Statera\", \"__name__\", \".*\"), \"metric\", \"Draw (W)\", \"__name__\", \".*\") or label_replace(label_replace((max(ananke_ups_runtime_seconds{job=\"ananke-power\",source=\"Statera\"}) or on() vector(0)), \"ups\", \"Statera\", \"__name__\", \".*\"), \"metric\", \"Discharge\", \"__name__\", \".*\") or label_replace(label_replace((max(ananke_ups_on_battery{job=\"ananke-power\",source=\"Statera\"}) or on() vector(0)), \"ups\", \"Statera\", \"__name__\", \".*\"), \"metric\", \"Status\", \"__name__\", \".*\")", "refId": "A", + "legendFormat": "{{ups}} {{metric}}", "instant": true } ], "fieldConfig": { "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgba(115, 115, 115, 1)", + "value": null + }, + { + "color": "green", + "value": 1 + } + ] + }, "unit": "none", "custom": { - "filterable": true - } + "displayMode": "auto" + }, + "decimals": 1 }, "overrides": [ { "matcher": { - "id": "byName", - "options": "Draw (W)" + "id": "byRegexp", + "options": ".*Draw \\(W\\)$" }, "properties": [ { @@ -1113,8 +1132,8 @@ }, { "matcher": { - "id": "byName", - "options": "Discharge" + "id": "byRegexp", + "options": ".*Discharge$" }, "properties": [ { @@ -1125,8 +1144,8 @@ }, { "matcher": { - "id": "byName", - "options": "Status" + "id": "byRegexp", + "options": ".*Status$" }, "properties": [ { @@ -1150,26 +1169,20 @@ ] }, "options": { - "showHeader": true, - "columnFilters": false - }, - "transformations": [ - { - "id": "labelsToFields", - "options": { - "mode": "columns", - "valueLabel": "metric" - } + "colorMode": "value", + "graphMode": "area", + "justifyMode": "center", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true - } - } - } - ], + "textMode": "name_and_value", + "orientation": "horizontal", + "wideLayout": false + }, "links": [ { "title": "Open atlas-power dashboard", @@ -1177,7 +1190,7 @@ "targetBlank": true } ], - "description": "Per-UPS two-row snapshot: draw (W), discharge runtime, and status." + "description": "Per-UPS live snapshot: draw, discharge runtime, and status." }, { "id": 41, @@ -1235,7 +1248,7 @@ }, { "id": 42, - "type": "table", + "type": "stat", "title": "Current Climate", "datasource": { "type": "prometheus", @@ -1251,15 +1264,34 @@ { "expr": "label_replace((max(max without (job,instance,pod,service,endpoint,namespace) (typhon_temperature_celsius)) or on() vector(0)), \"metric\", \"Temp \u00b0C\", \"__name__\", \".*\") or label_replace((max((max without (job,instance,pod,service,endpoint,namespace) (typhon_temperature_celsius)) * 9 / 5 + 32) or on() vector(0)), \"metric\", \"Temp \u00b0F\", \"__name__\", \".*\") or label_replace((max(max without (job,instance,pod,service,endpoint,namespace) (typhon_relative_humidity_percent)) or on() vector(0)), \"metric\", \"Humidity\", \"__name__\", \".*\") or label_replace((max(max without (job,instance,pod,service,endpoint,namespace) (typhon_vpd_kpa)) or on() vector(0)), \"metric\", \"Pressure\", \"__name__\", \".*\")", "refId": "A", + "legendFormat": "{{metric}}", "instant": true } ], "fieldConfig": { "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgba(115, 115, 115, 1)", + "value": null + }, + { + "color": "green", + "value": 1 + } + ] + }, "unit": "none", "custom": { - "filterable": true - } + "displayMode": "auto" + }, + "decimals": 2 }, "overrides": [ { @@ -1313,26 +1345,20 @@ ] }, "options": { - "showHeader": true, - "columnFilters": false - }, - "transformations": [ - { - "id": "labelsToFields", - "options": { - "mode": "columns", - "valueLabel": "metric" - } + "colorMode": "value", + "graphMode": "area", + "justifyMode": "center", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true - } - } - } - ], + "textMode": "name_and_value", + "orientation": "horizontal", + "wideLayout": false + }, "links": [ { "title": "Open atlas-power dashboard", @@ -1340,7 +1366,7 @@ "targetBlank": true } ], - "description": "Single-row climate snapshot: Temp \u00b0C, Temp \u00b0F, Humidity, Pressure." + "description": "Current tent values: Temp \u00b0C, Temp \u00b0F, Humidity, Pressure." }, { "id": 43, @@ -1436,7 +1462,7 @@ }, { "id": 140, - "type": "table", + "type": "stat", "title": "Fan Activity", "datasource": { "type": "prometheus", @@ -1452,15 +1478,38 @@ { "expr": "label_replace((round(max(max without (job,instance,pod,service,endpoint,namespace) (typhon_fan_speed_level{fan_group=\"outlet\"})) or on() vector(0))), \"metric\", \"Outlet\", \"__name__\", \".*\") or label_replace((round(max(max without (job,instance,pod,service,endpoint,namespace) (typhon_fan_speed_level{fan_group=\"inside_inlet\"})) or on() vector(0))), \"metric\", \"Inlet In\", \"__name__\", \".*\") or label_replace((round(max(max without (job,instance,pod,service,endpoint,namespace) (typhon_fan_speed_level{fan_group=\"outside_inlet\"})) or on() vector(0))), \"metric\", \"Inlet Out\", \"__name__\", \".*\") or label_replace((round(max(max without (job,instance,pod,service,endpoint,namespace) (typhon_fan_speed_level{fan_group=~\"interior|unknown\"})) or on() vector(0))), \"metric\", \"Interior\", \"__name__\", \".*\")", "refId": "A", + "legendFormat": "{{metric}}", "instant": true } ], "fieldConfig": { "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "yellow", + "value": 7 + }, + { + "color": "red", + "value": 9 + } + ] + }, "unit": "none", "custom": { - "filterable": true - } + "displayMode": "auto" + }, + "decimals": 0 }, "overrides": [ { @@ -1514,34 +1563,27 @@ ] }, "options": { - "showHeader": true, - "columnFilters": false - }, - "transformations": [ - { - "id": "labelsToFields", - "options": { - "mode": "columns", - "valueLabel": "metric" - } + "colorMode": "value", + "graphMode": "area", + "justifyMode": "center", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true - } - } - } - ], + "textMode": "name_and_value", + "orientation": "horizontal", + "wideLayout": false + }, "links": [ { "title": "Open atlas-power dashboard", "url": "/d/atlas-power", "targetBlank": true } - ], - "description": "Single-row fan snapshot: outlet, inlet in, inlet out, interior (0-10)." + ] }, { "id": 141, diff --git a/services/monitoring/dashboards/atlas-power.json b/services/monitoring/dashboards/atlas-power.json index 7677abd1..354ab430 100644 --- a/services/monitoring/dashboards/atlas-power.json +++ b/services/monitoring/dashboards/atlas-power.json @@ -6,7 +6,7 @@ "panels": [ { "id": 1, - "type": "table", + "type": "stat", "title": "UPS Current Load", "datasource": { "type": "prometheus", @@ -22,21 +22,40 @@ { "expr": "label_replace(label_replace((max((ananke_ups_load_percent{job=\"ananke-power\",source=\"Pyrphoros\"} * ananke_ups_power_nominal_watts{job=\"ananke-power\",source=\"Pyrphoros\"}) / 100) or on() vector(0)), \"ups\", \"Pyrphoros\", \"__name__\", \".*\"), \"metric\", \"Draw (W)\", \"__name__\", \".*\") or label_replace(label_replace((max(ananke_ups_runtime_seconds{job=\"ananke-power\",source=\"Pyrphoros\"}) or on() vector(0)), \"ups\", \"Pyrphoros\", \"__name__\", \".*\"), \"metric\", \"Discharge\", \"__name__\", \".*\") or label_replace(label_replace((max(ananke_ups_on_battery{job=\"ananke-power\",source=\"Pyrphoros\"}) or on() vector(0)), \"ups\", \"Pyrphoros\", \"__name__\", \".*\"), \"metric\", \"Status\", \"__name__\", \".*\") or label_replace(label_replace((max((ananke_ups_load_percent{job=\"ananke-power\",source=\"Statera\"} * ananke_ups_power_nominal_watts{job=\"ananke-power\",source=\"Statera\"}) / 100) or on() vector(0)), \"ups\", \"Statera\", \"__name__\", \".*\"), \"metric\", \"Draw (W)\", \"__name__\", \".*\") or label_replace(label_replace((max(ananke_ups_runtime_seconds{job=\"ananke-power\",source=\"Statera\"}) or on() vector(0)), \"ups\", \"Statera\", \"__name__\", \".*\"), \"metric\", \"Discharge\", \"__name__\", \".*\") or label_replace(label_replace((max(ananke_ups_on_battery{job=\"ananke-power\",source=\"Statera\"}) or on() vector(0)), \"ups\", \"Statera\", \"__name__\", \".*\"), \"metric\", \"Status\", \"__name__\", \".*\")", "refId": "A", + "legendFormat": "{{ups}} {{metric}}", "instant": true } ], "fieldConfig": { "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgba(115, 115, 115, 1)", + "value": null + }, + { + "color": "green", + "value": 1 + } + ] + }, "unit": "none", "custom": { - "filterable": true - } + "displayMode": "auto" + }, + "decimals": 1 }, "overrides": [ { "matcher": { - "id": "byName", - "options": "Draw (W)" + "id": "byRegexp", + "options": ".*Draw \\(W\\)$" }, "properties": [ { @@ -47,8 +66,8 @@ }, { "matcher": { - "id": "byName", - "options": "Discharge" + "id": "byRegexp", + "options": ".*Discharge$" }, "properties": [ { @@ -59,8 +78,8 @@ }, { "matcher": { - "id": "byName", - "options": "Status" + "id": "byRegexp", + "options": ".*Status$" }, "properties": [ { @@ -84,27 +103,21 @@ ] }, "options": { - "showHeader": true, - "columnFilters": false - }, - "transformations": [ - { - "id": "labelsToFields", - "options": { - "mode": "columns", - "valueLabel": "metric" - } + "colorMode": "value", + "graphMode": "area", + "justifyMode": "center", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true - } - } - } - ], - "description": "Per-UPS two-row snapshot: draw (W), discharge runtime, and charging/discharging status." + "textMode": "name_and_value", + "orientation": "horizontal", + "wideLayout": false + }, + "description": "Per-UPS live snapshot: draw, discharge runtime, and charging/discharging status." }, { "id": 2, @@ -156,7 +169,7 @@ }, { "id": 3, - "type": "table", + "type": "stat", "title": "Current Climate", "datasource": { "type": "prometheus", @@ -172,15 +185,34 @@ { "expr": "label_replace((max(max without (job,instance,pod,service,endpoint,namespace) (typhon_temperature_celsius)) or on() vector(0)), \"metric\", \"Temp \u00b0C\", \"__name__\", \".*\") or label_replace((max((max without (job,instance,pod,service,endpoint,namespace) (typhon_temperature_celsius)) * 9 / 5 + 32) or on() vector(0)), \"metric\", \"Temp \u00b0F\", \"__name__\", \".*\") or label_replace((max(max without (job,instance,pod,service,endpoint,namespace) (typhon_relative_humidity_percent)) or on() vector(0)), \"metric\", \"Humidity\", \"__name__\", \".*\") or label_replace((max(max without (job,instance,pod,service,endpoint,namespace) (typhon_vpd_kpa)) or on() vector(0)), \"metric\", \"Pressure\", \"__name__\", \".*\")", "refId": "A", + "legendFormat": "{{metric}}", "instant": true } ], "fieldConfig": { "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgba(115, 115, 115, 1)", + "value": null + }, + { + "color": "green", + "value": 1 + } + ] + }, "unit": "none", "custom": { - "filterable": true - } + "displayMode": "auto" + }, + "decimals": 2 }, "overrides": [ { @@ -234,27 +266,21 @@ ] }, "options": { - "showHeader": true, - "columnFilters": false - }, - "transformations": [ - { - "id": "labelsToFields", - "options": { - "mode": "columns", - "valueLabel": "metric" - } + "colorMode": "value", + "graphMode": "area", + "justifyMode": "center", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true - } - } - } - ], - "description": "Single-row climate snapshot: Temp \u00b0C, Temp \u00b0F, Humidity, Pressure." + "textMode": "name_and_value", + "orientation": "horizontal", + "wideLayout": false + }, + "description": "Current tent values: Temp \u00b0C, Temp \u00b0F, Humidity, Pressure." }, { "id": 4, @@ -360,7 +386,7 @@ }, { "id": 5, - "type": "table", + "type": "stat", "title": "Fan Activity", "datasource": { "type": "prometheus", @@ -376,15 +402,38 @@ { "expr": "label_replace((round(max(max without (job,instance,pod,service,endpoint,namespace) (typhon_fan_speed_level{fan_group=\"outlet\"})) or on() vector(0))), \"metric\", \"Outlet\", \"__name__\", \".*\") or label_replace((round(max(max without (job,instance,pod,service,endpoint,namespace) (typhon_fan_speed_level{fan_group=\"inside_inlet\"})) or on() vector(0))), \"metric\", \"Inlet In\", \"__name__\", \".*\") or label_replace((round(max(max without (job,instance,pod,service,endpoint,namespace) (typhon_fan_speed_level{fan_group=\"outside_inlet\"})) or on() vector(0))), \"metric\", \"Inlet Out\", \"__name__\", \".*\") or label_replace((round(max(max without (job,instance,pod,service,endpoint,namespace) (typhon_fan_speed_level{fan_group=~\"interior|unknown\"})) or on() vector(0))), \"metric\", \"Interior\", \"__name__\", \".*\")", "refId": "A", + "legendFormat": "{{metric}}", "instant": true } ], "fieldConfig": { "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "yellow", + "value": 7 + }, + { + "color": "red", + "value": 9 + } + ] + }, "unit": "none", "custom": { - "filterable": true - } + "displayMode": "auto" + }, + "decimals": 0 }, "overrides": [ { @@ -438,27 +487,21 @@ ] }, "options": { - "showHeader": true, - "columnFilters": false - }, - "transformations": [ - { - "id": "labelsToFields", - "options": { - "mode": "columns", - "valueLabel": "metric" - } + "colorMode": "value", + "graphMode": "area", + "justifyMode": "center", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true - } - } - } - ], - "description": "Single-row fan snapshot: outlet, inlet in, inlet out, interior (0-10)." + "textMode": "name_and_value", + "orientation": "horizontal", + "wideLayout": false + }, + "description": "Current fan activity levels: outlet, inlet in, inlet out, interior (0-10)." }, { "id": 6, diff --git a/services/monitoring/grafana-dashboard-overview.yaml b/services/monitoring/grafana-dashboard-overview.yaml index c7e0724f..347644ca 100644 --- a/services/monitoring/grafana-dashboard-overview.yaml +++ b/services/monitoring/grafana-dashboard-overview.yaml @@ -1081,7 +1081,7 @@ data: }, { "id": 40, - "type": "table", + "type": "stat", "title": "UPS Current Load", "datasource": { "type": "prometheus", @@ -1097,21 +1097,40 @@ data: { "expr": "label_replace(label_replace((max((ananke_ups_load_percent{job=\"ananke-power\",source=\"Pyrphoros\"} * ananke_ups_power_nominal_watts{job=\"ananke-power\",source=\"Pyrphoros\"}) / 100) or on() vector(0)), \"ups\", \"Pyrphoros\", \"__name__\", \".*\"), \"metric\", \"Draw (W)\", \"__name__\", \".*\") or label_replace(label_replace((max(ananke_ups_runtime_seconds{job=\"ananke-power\",source=\"Pyrphoros\"}) or on() vector(0)), \"ups\", \"Pyrphoros\", \"__name__\", \".*\"), \"metric\", \"Discharge\", \"__name__\", \".*\") or label_replace(label_replace((max(ananke_ups_on_battery{job=\"ananke-power\",source=\"Pyrphoros\"}) or on() vector(0)), \"ups\", \"Pyrphoros\", \"__name__\", \".*\"), \"metric\", \"Status\", \"__name__\", \".*\") or label_replace(label_replace((max((ananke_ups_load_percent{job=\"ananke-power\",source=\"Statera\"} * ananke_ups_power_nominal_watts{job=\"ananke-power\",source=\"Statera\"}) / 100) or on() vector(0)), \"ups\", \"Statera\", \"__name__\", \".*\"), \"metric\", \"Draw (W)\", \"__name__\", \".*\") or label_replace(label_replace((max(ananke_ups_runtime_seconds{job=\"ananke-power\",source=\"Statera\"}) or on() vector(0)), \"ups\", \"Statera\", \"__name__\", \".*\"), \"metric\", \"Discharge\", \"__name__\", \".*\") or label_replace(label_replace((max(ananke_ups_on_battery{job=\"ananke-power\",source=\"Statera\"}) or on() vector(0)), \"ups\", \"Statera\", \"__name__\", \".*\"), \"metric\", \"Status\", \"__name__\", \".*\")", "refId": "A", + "legendFormat": "{{ups}} {{metric}}", "instant": true } ], "fieldConfig": { "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgba(115, 115, 115, 1)", + "value": null + }, + { + "color": "green", + "value": 1 + } + ] + }, "unit": "none", "custom": { - "filterable": true - } + "displayMode": "auto" + }, + "decimals": 1 }, "overrides": [ { "matcher": { - "id": "byName", - "options": "Draw (W)" + "id": "byRegexp", + "options": ".*Draw \\(W\\)$" }, "properties": [ { @@ -1122,8 +1141,8 @@ data: }, { "matcher": { - "id": "byName", - "options": "Discharge" + "id": "byRegexp", + "options": ".*Discharge$" }, "properties": [ { @@ -1134,8 +1153,8 @@ data: }, { "matcher": { - "id": "byName", - "options": "Status" + "id": "byRegexp", + "options": ".*Status$" }, "properties": [ { @@ -1159,26 +1178,20 @@ data: ] }, "options": { - "showHeader": true, - "columnFilters": false - }, - "transformations": [ - { - "id": "labelsToFields", - "options": { - "mode": "columns", - "valueLabel": "metric" - } + "colorMode": "value", + "graphMode": "area", + "justifyMode": "center", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true - } - } - } - ], + "textMode": "name_and_value", + "orientation": "horizontal", + "wideLayout": false + }, "links": [ { "title": "Open atlas-power dashboard", @@ -1186,7 +1199,7 @@ data: "targetBlank": true } ], - "description": "Per-UPS two-row snapshot: draw (W), discharge runtime, and status." + "description": "Per-UPS live snapshot: draw, discharge runtime, and status." }, { "id": 41, @@ -1244,7 +1257,7 @@ data: }, { "id": 42, - "type": "table", + "type": "stat", "title": "Current Climate", "datasource": { "type": "prometheus", @@ -1260,15 +1273,34 @@ data: { "expr": "label_replace((max(max without (job,instance,pod,service,endpoint,namespace) (typhon_temperature_celsius)) or on() vector(0)), \"metric\", \"Temp \u00b0C\", \"__name__\", \".*\") or label_replace((max((max without (job,instance,pod,service,endpoint,namespace) (typhon_temperature_celsius)) * 9 / 5 + 32) or on() vector(0)), \"metric\", \"Temp \u00b0F\", \"__name__\", \".*\") or label_replace((max(max without (job,instance,pod,service,endpoint,namespace) (typhon_relative_humidity_percent)) or on() vector(0)), \"metric\", \"Humidity\", \"__name__\", \".*\") or label_replace((max(max without (job,instance,pod,service,endpoint,namespace) (typhon_vpd_kpa)) or on() vector(0)), \"metric\", \"Pressure\", \"__name__\", \".*\")", "refId": "A", + "legendFormat": "{{metric}}", "instant": true } ], "fieldConfig": { "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgba(115, 115, 115, 1)", + "value": null + }, + { + "color": "green", + "value": 1 + } + ] + }, "unit": "none", "custom": { - "filterable": true - } + "displayMode": "auto" + }, + "decimals": 2 }, "overrides": [ { @@ -1322,26 +1354,20 @@ data: ] }, "options": { - "showHeader": true, - "columnFilters": false - }, - "transformations": [ - { - "id": "labelsToFields", - "options": { - "mode": "columns", - "valueLabel": "metric" - } + "colorMode": "value", + "graphMode": "area", + "justifyMode": "center", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true - } - } - } - ], + "textMode": "name_and_value", + "orientation": "horizontal", + "wideLayout": false + }, "links": [ { "title": "Open atlas-power dashboard", @@ -1349,7 +1375,7 @@ data: "targetBlank": true } ], - "description": "Single-row climate snapshot: Temp \u00b0C, Temp \u00b0F, Humidity, Pressure." + "description": "Current tent values: Temp \u00b0C, Temp \u00b0F, Humidity, Pressure." }, { "id": 43, @@ -1445,7 +1471,7 @@ data: }, { "id": 140, - "type": "table", + "type": "stat", "title": "Fan Activity", "datasource": { "type": "prometheus", @@ -1461,15 +1487,38 @@ data: { "expr": "label_replace((round(max(max without (job,instance,pod,service,endpoint,namespace) (typhon_fan_speed_level{fan_group=\"outlet\"})) or on() vector(0))), \"metric\", \"Outlet\", \"__name__\", \".*\") or label_replace((round(max(max without (job,instance,pod,service,endpoint,namespace) (typhon_fan_speed_level{fan_group=\"inside_inlet\"})) or on() vector(0))), \"metric\", \"Inlet In\", \"__name__\", \".*\") or label_replace((round(max(max without (job,instance,pod,service,endpoint,namespace) (typhon_fan_speed_level{fan_group=\"outside_inlet\"})) or on() vector(0))), \"metric\", \"Inlet Out\", \"__name__\", \".*\") or label_replace((round(max(max without (job,instance,pod,service,endpoint,namespace) (typhon_fan_speed_level{fan_group=~\"interior|unknown\"})) or on() vector(0))), \"metric\", \"Interior\", \"__name__\", \".*\")", "refId": "A", + "legendFormat": "{{metric}}", "instant": true } ], "fieldConfig": { "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "yellow", + "value": 7 + }, + { + "color": "red", + "value": 9 + } + ] + }, "unit": "none", "custom": { - "filterable": true - } + "displayMode": "auto" + }, + "decimals": 0 }, "overrides": [ { @@ -1523,34 +1572,27 @@ data: ] }, "options": { - "showHeader": true, - "columnFilters": false - }, - "transformations": [ - { - "id": "labelsToFields", - "options": { - "mode": "columns", - "valueLabel": "metric" - } + "colorMode": "value", + "graphMode": "area", + "justifyMode": "center", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true - } - } - } - ], + "textMode": "name_and_value", + "orientation": "horizontal", + "wideLayout": false + }, "links": [ { "title": "Open atlas-power dashboard", "url": "/d/atlas-power", "targetBlank": true } - ], - "description": "Single-row fan snapshot: outlet, inlet in, inlet out, interior (0-10)." + ] }, { "id": 141, diff --git a/services/monitoring/grafana-dashboard-power.yaml b/services/monitoring/grafana-dashboard-power.yaml index 90745b9d..3e31d35d 100644 --- a/services/monitoring/grafana-dashboard-power.yaml +++ b/services/monitoring/grafana-dashboard-power.yaml @@ -15,7 +15,7 @@ data: "panels": [ { "id": 1, - "type": "table", + "type": "stat", "title": "UPS Current Load", "datasource": { "type": "prometheus", @@ -31,21 +31,40 @@ data: { "expr": "label_replace(label_replace((max((ananke_ups_load_percent{job=\"ananke-power\",source=\"Pyrphoros\"} * ananke_ups_power_nominal_watts{job=\"ananke-power\",source=\"Pyrphoros\"}) / 100) or on() vector(0)), \"ups\", \"Pyrphoros\", \"__name__\", \".*\"), \"metric\", \"Draw (W)\", \"__name__\", \".*\") or label_replace(label_replace((max(ananke_ups_runtime_seconds{job=\"ananke-power\",source=\"Pyrphoros\"}) or on() vector(0)), \"ups\", \"Pyrphoros\", \"__name__\", \".*\"), \"metric\", \"Discharge\", \"__name__\", \".*\") or label_replace(label_replace((max(ananke_ups_on_battery{job=\"ananke-power\",source=\"Pyrphoros\"}) or on() vector(0)), \"ups\", \"Pyrphoros\", \"__name__\", \".*\"), \"metric\", \"Status\", \"__name__\", \".*\") or label_replace(label_replace((max((ananke_ups_load_percent{job=\"ananke-power\",source=\"Statera\"} * ananke_ups_power_nominal_watts{job=\"ananke-power\",source=\"Statera\"}) / 100) or on() vector(0)), \"ups\", \"Statera\", \"__name__\", \".*\"), \"metric\", \"Draw (W)\", \"__name__\", \".*\") or label_replace(label_replace((max(ananke_ups_runtime_seconds{job=\"ananke-power\",source=\"Statera\"}) or on() vector(0)), \"ups\", \"Statera\", \"__name__\", \".*\"), \"metric\", \"Discharge\", \"__name__\", \".*\") or label_replace(label_replace((max(ananke_ups_on_battery{job=\"ananke-power\",source=\"Statera\"}) or on() vector(0)), \"ups\", \"Statera\", \"__name__\", \".*\"), \"metric\", \"Status\", \"__name__\", \".*\")", "refId": "A", + "legendFormat": "{{ups}} {{metric}}", "instant": true } ], "fieldConfig": { "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgba(115, 115, 115, 1)", + "value": null + }, + { + "color": "green", + "value": 1 + } + ] + }, "unit": "none", "custom": { - "filterable": true - } + "displayMode": "auto" + }, + "decimals": 1 }, "overrides": [ { "matcher": { - "id": "byName", - "options": "Draw (W)" + "id": "byRegexp", + "options": ".*Draw \\(W\\)$" }, "properties": [ { @@ -56,8 +75,8 @@ data: }, { "matcher": { - "id": "byName", - "options": "Discharge" + "id": "byRegexp", + "options": ".*Discharge$" }, "properties": [ { @@ -68,8 +87,8 @@ data: }, { "matcher": { - "id": "byName", - "options": "Status" + "id": "byRegexp", + "options": ".*Status$" }, "properties": [ { @@ -93,27 +112,21 @@ data: ] }, "options": { - "showHeader": true, - "columnFilters": false - }, - "transformations": [ - { - "id": "labelsToFields", - "options": { - "mode": "columns", - "valueLabel": "metric" - } + "colorMode": "value", + "graphMode": "area", + "justifyMode": "center", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true - } - } - } - ], - "description": "Per-UPS two-row snapshot: draw (W), discharge runtime, and charging/discharging status." + "textMode": "name_and_value", + "orientation": "horizontal", + "wideLayout": false + }, + "description": "Per-UPS live snapshot: draw, discharge runtime, and charging/discharging status." }, { "id": 2, @@ -165,7 +178,7 @@ data: }, { "id": 3, - "type": "table", + "type": "stat", "title": "Current Climate", "datasource": { "type": "prometheus", @@ -181,15 +194,34 @@ data: { "expr": "label_replace((max(max without (job,instance,pod,service,endpoint,namespace) (typhon_temperature_celsius)) or on() vector(0)), \"metric\", \"Temp \u00b0C\", \"__name__\", \".*\") or label_replace((max((max without (job,instance,pod,service,endpoint,namespace) (typhon_temperature_celsius)) * 9 / 5 + 32) or on() vector(0)), \"metric\", \"Temp \u00b0F\", \"__name__\", \".*\") or label_replace((max(max without (job,instance,pod,service,endpoint,namespace) (typhon_relative_humidity_percent)) or on() vector(0)), \"metric\", \"Humidity\", \"__name__\", \".*\") or label_replace((max(max without (job,instance,pod,service,endpoint,namespace) (typhon_vpd_kpa)) or on() vector(0)), \"metric\", \"Pressure\", \"__name__\", \".*\")", "refId": "A", + "legendFormat": "{{metric}}", "instant": true } ], "fieldConfig": { "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgba(115, 115, 115, 1)", + "value": null + }, + { + "color": "green", + "value": 1 + } + ] + }, "unit": "none", "custom": { - "filterable": true - } + "displayMode": "auto" + }, + "decimals": 2 }, "overrides": [ { @@ -243,27 +275,21 @@ data: ] }, "options": { - "showHeader": true, - "columnFilters": false - }, - "transformations": [ - { - "id": "labelsToFields", - "options": { - "mode": "columns", - "valueLabel": "metric" - } + "colorMode": "value", + "graphMode": "area", + "justifyMode": "center", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true - } - } - } - ], - "description": "Single-row climate snapshot: Temp \u00b0C, Temp \u00b0F, Humidity, Pressure." + "textMode": "name_and_value", + "orientation": "horizontal", + "wideLayout": false + }, + "description": "Current tent values: Temp \u00b0C, Temp \u00b0F, Humidity, Pressure." }, { "id": 4, @@ -369,7 +395,7 @@ data: }, { "id": 5, - "type": "table", + "type": "stat", "title": "Fan Activity", "datasource": { "type": "prometheus", @@ -385,15 +411,38 @@ data: { "expr": "label_replace((round(max(max without (job,instance,pod,service,endpoint,namespace) (typhon_fan_speed_level{fan_group=\"outlet\"})) or on() vector(0))), \"metric\", \"Outlet\", \"__name__\", \".*\") or label_replace((round(max(max without (job,instance,pod,service,endpoint,namespace) (typhon_fan_speed_level{fan_group=\"inside_inlet\"})) or on() vector(0))), \"metric\", \"Inlet In\", \"__name__\", \".*\") or label_replace((round(max(max without (job,instance,pod,service,endpoint,namespace) (typhon_fan_speed_level{fan_group=\"outside_inlet\"})) or on() vector(0))), \"metric\", \"Inlet Out\", \"__name__\", \".*\") or label_replace((round(max(max without (job,instance,pod,service,endpoint,namespace) (typhon_fan_speed_level{fan_group=~\"interior|unknown\"})) or on() vector(0))), \"metric\", \"Interior\", \"__name__\", \".*\")", "refId": "A", + "legendFormat": "{{metric}}", "instant": true } ], "fieldConfig": { "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "yellow", + "value": 7 + }, + { + "color": "red", + "value": 9 + } + ] + }, "unit": "none", "custom": { - "filterable": true - } + "displayMode": "auto" + }, + "decimals": 0 }, "overrides": [ { @@ -447,27 +496,21 @@ data: ] }, "options": { - "showHeader": true, - "columnFilters": false - }, - "transformations": [ - { - "id": "labelsToFields", - "options": { - "mode": "columns", - "valueLabel": "metric" - } + "colorMode": "value", + "graphMode": "area", + "justifyMode": "center", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true - } - } - } - ], - "description": "Single-row fan snapshot: outlet, inlet in, inlet out, interior (0-10)." + "textMode": "name_and_value", + "orientation": "horizontal", + "wideLayout": false + }, + "description": "Current fan activity levels: outlet, inlet in, inlet out, interior (0-10)." }, { "id": 6,