From 82e1b87b8ff0af05e40e75809a0acdbcb7c70964 Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Sat, 4 Apr 2026 04:40:22 -0300 Subject: [PATCH] monitoring(overview): refine ups-climate row and climate/fan stat display --- scripts/dashboards_render_atlas.py | 14 +++++++++----- services/monitoring/dashboards/atlas-overview.json | 13 +++++++------ .../monitoring/grafana-dashboard-overview.yaml | 13 +++++++------ services/monitoring/helmrelease.yaml | 2 +- 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/scripts/dashboards_render_atlas.py b/scripts/dashboards_render_atlas.py index 6cecdc91..7ec34e64 100644 --- a/scripts/dashboards_render_atlas.py +++ b/scripts/dashboards_render_atlas.py @@ -647,6 +647,7 @@ def stat_panel( field_overrides=None, description=None, orientation=None, + wide_layout=None, ): """Return a Grafana stat panel definition.""" defaults = { @@ -687,6 +688,8 @@ def stat_panel( } if orientation: panel["options"]["orientation"] = orientation + if wide_layout is not None: + panel["options"]["wideLayout"] = wide_layout if legend and len(panel["targets"]) == 1: panel["targets"][0]["legendFormat"] = legend if instant: @@ -1337,11 +1340,12 @@ def build_overview(): ], field_overrides=[ {"matcher": {"id": "byName", "options": "Tent Temp (°C)"}, "properties": [{"id": "unit", "value": "celsius"}]}, - {"matcher": {"id": "byName", "options": "Tent Pressure (kPa)"}, "properties": [{"id": "unit", "value": "none"}]}, + {"matcher": {"id": "byName", "options": "Tent Pressure (kPa)"}, "properties": [{"id": "unit", "value": "suffix:kPa"}]}, ], links=link_to("atlas-power"), description="Current tent temperature and pressure.", orientation="vertical", + wide_layout=False, ) ) panels.append( @@ -1381,10 +1385,10 @@ def build_overview(): decimals=0, text_mode="name_and_value", targets=[ - {"refId": "A", "expr": CLIMATE_FAN_OUTLET_CURRENT, "legendFormat": "Outlet", "instant": True}, - {"refId": "B", "expr": CLIMATE_FAN_INSIDE_INLET_CURRENT, "legendFormat": "Inside Inlet", "instant": True}, - {"refId": "C", "expr": CLIMATE_FAN_OUTSIDE_INLET_CURRENT, "legendFormat": "Outside Inlet", "instant": True}, - {"refId": "D", "expr": CLIMATE_FAN_INTERIOR_CURRENT, "legendFormat": "Interior", "instant": True}, + {"refId": "A", "expr": f"round({CLIMATE_FAN_OUTLET_CURRENT})", "legendFormat": "Outlet", "instant": True}, + {"refId": "B", "expr": f"round({CLIMATE_FAN_INSIDE_INLET_CURRENT})", "legendFormat": "Inside Inlet", "instant": True}, + {"refId": "C", "expr": f"round({CLIMATE_FAN_OUTSIDE_INLET_CURRENT})", "legendFormat": "Outside Inlet", "instant": True}, + {"refId": "D", "expr": f"round({CLIMATE_FAN_INTERIOR_CURRENT})", "legendFormat": "Interior", "instant": True}, ], thresholds={ "mode": "absolute", diff --git a/services/monitoring/dashboards/atlas-overview.json b/services/monitoring/dashboards/atlas-overview.json index fb56f351..40077ae1 100644 --- a/services/monitoring/dashboards/atlas-overview.json +++ b/services/monitoring/dashboards/atlas-overview.json @@ -1396,7 +1396,7 @@ "properties": [ { "id": "unit", - "value": "none" + "value": "suffix:kPa" } ] } @@ -1414,7 +1414,8 @@ "values": false }, "textMode": "value", - "orientation": "vertical" + "orientation": "vertical", + "wideLayout": false }, "links": [ { @@ -1516,25 +1517,25 @@ "targets": [ { "refId": "A", - "expr": "max(atlas_climate_fan_activity_level{fan_group=\"outlet\"}) or max(atlas_climate_fan_activity_level{position=\"outlet\"}) or on() vector(0)", + "expr": "round(max(atlas_climate_fan_activity_level{fan_group=\"outlet\"}) or max(atlas_climate_fan_activity_level{position=\"outlet\"}) or on() vector(0))", "legendFormat": "Outlet", "instant": true }, { "refId": "B", - "expr": "max(atlas_climate_fan_activity_level{fan_group=\"inside_inlet\"}) or max(atlas_climate_fan_activity_level{position=\"inside_inlet\"}) or on() vector(0)", + "expr": "round(max(atlas_climate_fan_activity_level{fan_group=\"inside_inlet\"}) or max(atlas_climate_fan_activity_level{position=\"inside_inlet\"}) or on() vector(0))", "legendFormat": "Inside Inlet", "instant": true }, { "refId": "C", - "expr": "max(atlas_climate_fan_activity_level{fan_group=\"outside_inlet\"}) or max(atlas_climate_fan_activity_level{position=\"outside_inlet\"}) or on() vector(0)", + "expr": "round(max(atlas_climate_fan_activity_level{fan_group=\"outside_inlet\"}) or max(atlas_climate_fan_activity_level{position=\"outside_inlet\"}) or on() vector(0))", "legendFormat": "Outside Inlet", "instant": true }, { "refId": "D", - "expr": "max(atlas_climate_fan_activity_level{fan_group=\"interior\"}) or max(atlas_climate_fan_activity_level{position=\"interior\"}) or on() vector(0)", + "expr": "round(max(atlas_climate_fan_activity_level{fan_group=\"interior\"}) or max(atlas_climate_fan_activity_level{position=\"interior\"}) or on() vector(0))", "legendFormat": "Interior", "instant": true } diff --git a/services/monitoring/grafana-dashboard-overview.yaml b/services/monitoring/grafana-dashboard-overview.yaml index 1cc56bad..e8869a58 100644 --- a/services/monitoring/grafana-dashboard-overview.yaml +++ b/services/monitoring/grafana-dashboard-overview.yaml @@ -1405,7 +1405,7 @@ data: "properties": [ { "id": "unit", - "value": "none" + "value": "suffix:kPa" } ] } @@ -1423,7 +1423,8 @@ data: "values": false }, "textMode": "value", - "orientation": "vertical" + "orientation": "vertical", + "wideLayout": false }, "links": [ { @@ -1525,25 +1526,25 @@ data: "targets": [ { "refId": "A", - "expr": "max(atlas_climate_fan_activity_level{fan_group=\"outlet\"}) or max(atlas_climate_fan_activity_level{position=\"outlet\"}) or on() vector(0)", + "expr": "round(max(atlas_climate_fan_activity_level{fan_group=\"outlet\"}) or max(atlas_climate_fan_activity_level{position=\"outlet\"}) or on() vector(0))", "legendFormat": "Outlet", "instant": true }, { "refId": "B", - "expr": "max(atlas_climate_fan_activity_level{fan_group=\"inside_inlet\"}) or max(atlas_climate_fan_activity_level{position=\"inside_inlet\"}) or on() vector(0)", + "expr": "round(max(atlas_climate_fan_activity_level{fan_group=\"inside_inlet\"}) or max(atlas_climate_fan_activity_level{position=\"inside_inlet\"}) or on() vector(0))", "legendFormat": "Inside Inlet", "instant": true }, { "refId": "C", - "expr": "max(atlas_climate_fan_activity_level{fan_group=\"outside_inlet\"}) or max(atlas_climate_fan_activity_level{position=\"outside_inlet\"}) or on() vector(0)", + "expr": "round(max(atlas_climate_fan_activity_level{fan_group=\"outside_inlet\"}) or max(atlas_climate_fan_activity_level{position=\"outside_inlet\"}) or on() vector(0))", "legendFormat": "Outside Inlet", "instant": true }, { "refId": "D", - "expr": "max(atlas_climate_fan_activity_level{fan_group=\"interior\"}) or max(atlas_climate_fan_activity_level{position=\"interior\"}) or on() vector(0)", + "expr": "round(max(atlas_climate_fan_activity_level{fan_group=\"interior\"}) or max(atlas_climate_fan_activity_level{position=\"interior\"}) or on() vector(0))", "legendFormat": "Interior", "instant": true } diff --git a/services/monitoring/helmrelease.yaml b/services/monitoring/helmrelease.yaml index 5d815c55..b1221512 100644 --- a/services/monitoring/helmrelease.yaml +++ b/services/monitoring/helmrelease.yaml @@ -296,7 +296,7 @@ spec: podAnnotations: vault.hashicorp.com/agent-inject: "true" vault.hashicorp.com/role: "monitoring" - monitoring.bstein.dev/restart-rev: "9" + monitoring.bstein.dev/restart-rev: "10" vault.hashicorp.com/agent-inject-secret-grafana-env.sh: "kv/data/atlas/monitoring/grafana-admin" vault.hashicorp.com/agent-inject-template-grafana-env.sh: | {{ with secret "kv/data/atlas/monitoring/grafana-admin" }}