monitoring: make overview history panels visible

This commit is contained in:
jenkins 2026-05-16 06:11:22 -03:00
parent 4238262ad3
commit fbf768e90f
4 changed files with 58 additions and 101 deletions

View File

@ -1911,44 +1911,32 @@ def build_overview():
panel["options"]["text"] = compact_current_text panel["options"]["text"] = compact_current_text
panels.append(panel) panels.append(panel)
panels.append( ups_history = timeseries_panel(
apply_bar_timeseries_style( 41,
timeseries_panel( "UPS History (Power Draw)",
41, None,
"UPS History (Power Draw)", {"h": 6, "w": 6, "x": 3, "y": 7},
None, unit="watt",
{"h": 6, "w": 6, "x": 3, "y": 7}, targets=[
unit="watt", {"refId": "A", "expr": ANANKE_UPS_DRAW_WATTS_DB_SERIES, "legendFormat": ANANKE_UPS_DB_NAME},
targets=[ {"refId": "B", "expr": ANANKE_UPS_DRAW_WATTS_TETHYS_SERIES, "legendFormat": ANANKE_UPS_TETHYS_NAME},
{"refId": "A", "expr": ANANKE_UPS_DRAW_WATTS_DB_SERIES, "legendFormat": ANANKE_UPS_DB_NAME}, ],
{"refId": "B", "expr": ANANKE_UPS_DRAW_WATTS_TETHYS_SERIES, "legendFormat": ANANKE_UPS_TETHYS_NAME}, field_overrides=fixed_color_overrides(
], {ANANKE_UPS_DB_NAME: dark_blue, ANANKE_UPS_TETHYS_NAME: dark_yellow}
field_overrides=[ ),
{ legend_display="list",
"matcher": {"id": "byName", "options": ANANKE_UPS_DB_NAME}, legend_placement="bottom",
"properties": [ links=overview_link("atlas-power"),
{"id": "color", "value": {"mode": "fixed", "fixedColor": dark_blue}},
{"id": "custom.barAlignment", "value": -1},
{"id": "custom.barWidthFactor", "value": 0.42},
],
},
{
"matcher": {"id": "byName", "options": ANANKE_UPS_TETHYS_NAME},
"properties": [
{"id": "color", "value": {"mode": "fixed", "fixedColor": dark_yellow}},
{"id": "custom.barAlignment", "value": 1},
{"id": "custom.barWidthFactor", "value": 0.42},
],
},
],
legend_display="table",
legend_placement="bottom",
links=overview_link("atlas-power"),
),
stacked=False,
fill_opacity=55,
)
) )
ups_history["fieldConfig"]["defaults"]["custom"] = {
"drawStyle": "line",
"lineInterpolation": "linear",
"lineWidth": 2,
"fillOpacity": 18,
"showPoints": "never",
"spanNulls": True,
}
panels.append(ups_history)
temp_panel = stat_panel( temp_panel = stat_panel(
42, 42,
"Current Enclosure Temperature", "Current Enclosure Temperature",
@ -2118,7 +2106,9 @@ def build_overview():
links=overview_link("atlas-power"), links=overview_link("atlas-power"),
description="Fan intensity lanes on the 0-10 controller scale. Cooler colors are quiet/low intensity; warmer colors mean the enclosure is pushing harder.", description="Fan intensity lanes on the 0-10 controller scale. Cooler colors are quiet/low intensity; warmer colors mean the enclosure is pushing harder.",
) )
fan_panel["options"]["legend"] = {"displayMode": "hidden", "placement": "bottom"} fan_panel["options"]["legend"] = {"displayMode": "list", "placement": "bottom"}
fan_panel["options"]["mergeValues"] = False
fan_panel["options"]["showValue"] = "auto"
fan_panel["options"]["tooltip"] = {"mode": "multi", "sort": "none"} fan_panel["options"]["tooltip"] = {"mode": "multi", "sort": "none"}
panels.append(fan_panel) panels.append(fan_panel)
flux_source = stat_panel( flux_source = stat_panel(
@ -2236,6 +2226,8 @@ def build_overview():
) )
) )
panels[-1]["options"]["legend"] = {"displayMode": "hidden", "placement": "bottom"} panels[-1]["options"]["legend"] = {"displayMode": "hidden", "placement": "bottom"}
panels[-1]["options"]["mergeValues"] = False
panels[-1]["options"]["showValue"] = "auto"
for panel_id, title, metric, x_pos, description in [ for panel_id, title, metric, x_pos, description in [
( (
142, 142,

View File

@ -80,19 +80,16 @@ def test_overview_uses_readable_quality_power_and_gitops_panels():
assert panels_by_title["Pyrphoros UPS Current"]["gridPos"]["w"] == 3 assert panels_by_title["Pyrphoros UPS Current"]["gridPos"]["w"] == 3
assert panels_by_title["Current Enclosure Climate"]["gridPos"]["w"] == 3 assert panels_by_title["Current Enclosure Climate"]["gridPos"]["w"] == 3
assert panels_by_title["UPS History (Power Draw)"]["options"]["legend"]["placement"] == "bottom" assert panels_by_title["UPS History (Power Draw)"]["options"]["legend"]["placement"] == "bottom"
assert panels_by_title["UPS History (Power Draw)"]["fieldConfig"]["defaults"]["custom"]["drawStyle"] == "bars" assert panels_by_title["UPS History (Power Draw)"]["options"]["legend"]["displayMode"] == "list"
assert panels_by_title["UPS History (Power Draw)"]["fieldConfig"]["defaults"]["custom"]["barWidthFactor"] == 0.72 assert panels_by_title["UPS History (Power Draw)"]["fieldConfig"]["defaults"]["custom"]["drawStyle"] == "line"
assert panels_by_title["UPS History (Power Draw)"]["fieldConfig"]["defaults"]["custom"]["fillOpacity"] == 18
ups_overrides = panels_by_title["UPS History (Power Draw)"]["fieldConfig"]["overrides"] ups_overrides = panels_by_title["UPS History (Power Draw)"]["fieldConfig"]["overrides"]
ups_override_by_name = {override["matcher"]["options"]: override for override in ups_overrides} ups_override_by_name = {override["matcher"]["options"]: override for override in ups_overrides}
assert ups_override_by_name["Pyrphoros"]["properties"] == [ assert ups_override_by_name["Pyrphoros"]["properties"] == [
{"id": "color", "value": {"mode": "fixed", "fixedColor": "dark-blue"}}, {"id": "color", "value": {"mode": "fixed", "fixedColor": "dark-blue"}},
{"id": "custom.barAlignment", "value": -1},
{"id": "custom.barWidthFactor", "value": 0.42},
] ]
assert ups_override_by_name["Statera"]["properties"] == [ assert ups_override_by_name["Statera"]["properties"] == [
{"id": "color", "value": {"mode": "fixed", "fixedColor": "dark-yellow"}}, {"id": "color", "value": {"mode": "fixed", "fixedColor": "dark-yellow"}},
{"id": "custom.barAlignment", "value": 1},
{"id": "custom.barWidthFactor", "value": 0.42},
] ]
assert panels_by_title["Ariadne Run Volume"]["fieldConfig"]["defaults"]["custom"]["drawStyle"] == "bars" assert panels_by_title["Ariadne Run Volume"]["fieldConfig"]["defaults"]["custom"]["drawStyle"] == "bars"
assert panels_by_title["Ariadne Run Volume"]["options"]["legend"]["placement"] == "bottom" assert panels_by_title["Ariadne Run Volume"]["options"]["legend"]["placement"] == "bottom"
@ -107,7 +104,9 @@ def test_overview_uses_readable_quality_power_and_gitops_panels():
assert fan_steps[0]["color"] == "#1f60c4" assert fan_steps[0]["color"] == "#1f60c4"
assert fan_steps[5]["color"] == "#d4b106" assert fan_steps[5]["color"] == "#d4b106"
assert fan_steps[-1]["color"] == "#8f1d1d" assert fan_steps[-1]["color"] == "#8f1d1d"
assert panels_by_title["Fan Intensity History"]["options"]["legend"]["displayMode"] == "hidden" assert panels_by_title["Fan Intensity History"]["options"]["legend"]["displayMode"] == "list"
assert panels_by_title["Fan Intensity History"]["options"]["mergeValues"] is False
assert panels_by_title["Fan Intensity History"]["options"]["showValue"] == "auto"
assert panels_by_title["Flux Source"]["type"] == "stat" assert panels_by_title["Flux Source"]["type"] == "stat"
assert panels_by_title["Flux Source"]["gridPos"] == {"h": 2, "w": 3, "x": 21, "y": 7} assert panels_by_title["Flux Source"]["gridPos"] == {"h": 2, "w": 3, "x": 21, "y": 7}
@ -121,6 +120,8 @@ def test_overview_uses_readable_quality_power_and_gitops_panels():
assert "Kustomizations Not Suspended" in gitops_expr assert "Kustomizations Not Suspended" in gitops_expr
assert "HelmReleases Not Suspended" in gitops_expr assert "HelmReleases Not Suspended" in gitops_expr
assert panels_by_title["Gate Checks Passing by Suite"]["options"]["legend"]["displayMode"] == "hidden" assert panels_by_title["Gate Checks Passing by Suite"]["options"]["legend"]["displayMode"] == "hidden"
assert panels_by_title["Gate Checks Passing by Suite"]["options"]["mergeValues"] is False
assert panels_by_title["Gate Checks Passing by Suite"]["options"]["showValue"] == "auto"
assert "rowHeight" not in panels_by_title["Gate Checks Passing by Suite"]["options"] assert "rowHeight" not in panels_by_title["Gate Checks Passing by Suite"]["options"]
pvc_backup_expr = panels_by_title["PVC Backup Health / Age"]["targets"][0]["expr"] pvc_backup_expr = panels_by_title["PVC Backup Health / Age"]["targets"][0]["expr"]

View File

@ -1298,12 +1298,10 @@
"defaults": { "defaults": {
"unit": "watt", "unit": "watt",
"custom": { "custom": {
"drawStyle": "bars", "drawStyle": "line",
"barAlignment": 0, "lineInterpolation": "linear",
"barWidthFactor": 0.72, "lineWidth": 2,
"lineWidth": 0, "fillOpacity": 18,
"fillOpacity": 55,
"gradientMode": "none",
"showPoints": "never", "showPoints": "never",
"spanNulls": true "spanNulls": true
} }
@ -1321,14 +1319,6 @@
"mode": "fixed", "mode": "fixed",
"fixedColor": "dark-blue" "fixedColor": "dark-blue"
} }
},
{
"id": "custom.barAlignment",
"value": -1
},
{
"id": "custom.barWidthFactor",
"value": 0.42
} }
] ]
}, },
@ -1344,14 +1334,6 @@
"mode": "fixed", "mode": "fixed",
"fixedColor": "dark-yellow" "fixedColor": "dark-yellow"
} }
},
{
"id": "custom.barAlignment",
"value": 1
},
{
"id": "custom.barWidthFactor",
"value": 0.42
} }
] ]
} }
@ -1359,7 +1341,7 @@
}, },
"options": { "options": {
"legend": { "legend": {
"displayMode": "table", "displayMode": "list",
"placement": "bottom" "placement": "bottom"
}, },
"tooltip": { "tooltip": {
@ -1965,10 +1947,10 @@
"overrides": [] "overrides": []
}, },
"options": { "options": {
"mergeValues": true, "mergeValues": false,
"showValue": "never", "showValue": "auto",
"legend": { "legend": {
"displayMode": "hidden", "displayMode": "list",
"placement": "bottom" "placement": "bottom"
}, },
"tooltip": { "tooltip": {
@ -2796,8 +2778,8 @@
"overrides": [] "overrides": []
}, },
"options": { "options": {
"mergeValues": true, "mergeValues": false,
"showValue": "never", "showValue": "auto",
"legend": { "legend": {
"displayMode": "hidden", "displayMode": "hidden",
"placement": "bottom" "placement": "bottom"

View File

@ -1307,12 +1307,10 @@ data:
"defaults": { "defaults": {
"unit": "watt", "unit": "watt",
"custom": { "custom": {
"drawStyle": "bars", "drawStyle": "line",
"barAlignment": 0, "lineInterpolation": "linear",
"barWidthFactor": 0.72, "lineWidth": 2,
"lineWidth": 0, "fillOpacity": 18,
"fillOpacity": 55,
"gradientMode": "none",
"showPoints": "never", "showPoints": "never",
"spanNulls": true "spanNulls": true
} }
@ -1330,14 +1328,6 @@ data:
"mode": "fixed", "mode": "fixed",
"fixedColor": "dark-blue" "fixedColor": "dark-blue"
} }
},
{
"id": "custom.barAlignment",
"value": -1
},
{
"id": "custom.barWidthFactor",
"value": 0.42
} }
] ]
}, },
@ -1353,14 +1343,6 @@ data:
"mode": "fixed", "mode": "fixed",
"fixedColor": "dark-yellow" "fixedColor": "dark-yellow"
} }
},
{
"id": "custom.barAlignment",
"value": 1
},
{
"id": "custom.barWidthFactor",
"value": 0.42
} }
] ]
} }
@ -1368,7 +1350,7 @@ data:
}, },
"options": { "options": {
"legend": { "legend": {
"displayMode": "table", "displayMode": "list",
"placement": "bottom" "placement": "bottom"
}, },
"tooltip": { "tooltip": {
@ -1974,10 +1956,10 @@ data:
"overrides": [] "overrides": []
}, },
"options": { "options": {
"mergeValues": true, "mergeValues": false,
"showValue": "never", "showValue": "auto",
"legend": { "legend": {
"displayMode": "hidden", "displayMode": "list",
"placement": "bottom" "placement": "bottom"
}, },
"tooltip": { "tooltip": {
@ -2805,8 +2787,8 @@ data:
"overrides": [] "overrides": []
}, },
"options": { "options": {
"mergeValues": true, "mergeValues": false,
"showValue": "never", "showValue": "auto",
"legend": { "legend": {
"displayMode": "hidden", "displayMode": "hidden",
"placement": "bottom" "placement": "bottom"