monitoring(overview): stack climate stats into explicit 2x2 rows

This commit is contained in:
Brad Stein 2026-04-12 22:19:37 -03:00
parent 4efd28c956
commit e53933ece7
3 changed files with 264 additions and 19 deletions

View File

@ -1527,14 +1527,11 @@ def build_overview():
42,
"Current Climate",
CLIMATE_CURRENT_ROW_TOP_EXPR,
{"h": 6, "w": 6, "x": 0, "y": 12},
{"h": 3, "w": 6, "x": 0, "y": 12},
unit="none",
decimals=2,
text_mode="name_and_value",
targets=[
{"expr": CLIMATE_CURRENT_ROW_TOP_EXPR, "refId": "A", "legendFormat": "{{metric}}", "instant": True},
{"expr": CLIMATE_CURRENT_ROW_BOTTOM_EXPR, "refId": "B", "legendFormat": "{{metric}}", "instant": True},
],
legend="{{metric}}",
instant=True,
field_overrides=[
{"matcher": {"id": "byName", "options": "Temp °C"}, "properties": [{"id": "unit", "value": "celsius"}]},
@ -1550,6 +1547,30 @@ def build_overview():
value_size=28,
)
)
panels.append(
stat_panel(
143,
"",
CLIMATE_CURRENT_ROW_BOTTOM_EXPR,
{"h": 3, "w": 6, "x": 0, "y": 15},
unit="none",
decimals=2,
text_mode="name_and_value",
legend="{{metric}}",
instant=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"}]},
],
orientation="vertical",
wide_layout=False,
title_size=16,
value_size=28,
graph_mode="none",
)
)
panels.append(
timeseries_panel(
43,

View File

@ -1241,7 +1241,7 @@
"uid": "atlas-vm"
},
"gridPos": {
"h": 6,
"h": 3,
"w": 6,
"x": 0,
"y": 12
@ -1252,12 +1252,6 @@
"refId": "A",
"legendFormat": "{{metric}}",
"instant": true
},
{
"expr": "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": "B",
"legendFormat": "{{metric}}",
"instant": true
}
],
"fieldConfig": {
@ -1364,6 +1358,124 @@
],
"description": "Current tent values: Temp \u00b0C, Temp \u00b0F, Humidity, Pressure."
},
{
"id": 143,
"type": "stat",
"title": "",
"datasource": {
"type": "prometheus",
"uid": "atlas-vm"
},
"gridPos": {
"h": 3,
"w": 6,
"x": 0,
"y": 15
},
"targets": [
{
"expr": "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": {
"displayMode": "auto"
},
"decimals": 2
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Temp \u00b0C"
},
"properties": [
{
"id": "unit",
"value": "celsius"
}
]
},
{
"matcher": {
"id": "byName",
"options": "Temp \u00b0F"
},
"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"
}
]
}
]
},
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "center",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "name_and_value",
"orientation": "vertical",
"wideLayout": false,
"text": {
"titleSize": 16,
"valueSize": 28
}
}
},
{
"id": 43,
"type": "timeseries",

View File

@ -1250,7 +1250,7 @@ data:
"uid": "atlas-vm"
},
"gridPos": {
"h": 6,
"h": 3,
"w": 6,
"x": 0,
"y": 12
@ -1261,12 +1261,6 @@ data:
"refId": "A",
"legendFormat": "{{metric}}",
"instant": true
},
{
"expr": "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": "B",
"legendFormat": "{{metric}}",
"instant": true
}
],
"fieldConfig": {
@ -1373,6 +1367,124 @@ data:
],
"description": "Current tent values: Temp \u00b0C, Temp \u00b0F, Humidity, Pressure."
},
{
"id": 143,
"type": "stat",
"title": "",
"datasource": {
"type": "prometheus",
"uid": "atlas-vm"
},
"gridPos": {
"h": 3,
"w": 6,
"x": 0,
"y": 15
},
"targets": [
{
"expr": "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": {
"displayMode": "auto"
},
"decimals": 2
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Temp \u00b0C"
},
"properties": [
{
"id": "unit",
"value": "celsius"
}
]
},
{
"matcher": {
"id": "byName",
"options": "Temp \u00b0F"
},
"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"
}
]
}
]
},
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "center",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "name_and_value",
"orientation": "vertical",
"wideLayout": false,
"text": {
"titleSize": 16,
"valueSize": 28
}
}
},
{
"id": 43,
"type": "timeseries",