monitoring: make overview history panels visible
This commit is contained in:
parent
4238262ad3
commit
fbf768e90f
@ -1911,44 +1911,32 @@ def build_overview():
|
||||
panel["options"]["text"] = compact_current_text
|
||||
panels.append(panel)
|
||||
|
||||
panels.append(
|
||||
apply_bar_timeseries_style(
|
||||
timeseries_panel(
|
||||
41,
|
||||
"UPS History (Power Draw)",
|
||||
None,
|
||||
{"h": 6, "w": 6, "x": 3, "y": 7},
|
||||
unit="watt",
|
||||
targets=[
|
||||
{"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=[
|
||||
{
|
||||
"matcher": {"id": "byName", "options": ANANKE_UPS_DB_NAME},
|
||||
"properties": [
|
||||
{"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 = timeseries_panel(
|
||||
41,
|
||||
"UPS History (Power Draw)",
|
||||
None,
|
||||
{"h": 6, "w": 6, "x": 3, "y": 7},
|
||||
unit="watt",
|
||||
targets=[
|
||||
{"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}
|
||||
),
|
||||
legend_display="list",
|
||||
legend_placement="bottom",
|
||||
links=overview_link("atlas-power"),
|
||||
)
|
||||
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(
|
||||
42,
|
||||
"Current Enclosure Temperature",
|
||||
@ -2118,7 +2106,9 @@ def build_overview():
|
||||
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.",
|
||||
)
|
||||
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"}
|
||||
panels.append(fan_panel)
|
||||
flux_source = stat_panel(
|
||||
@ -2236,6 +2226,8 @@ def build_overview():
|
||||
)
|
||||
)
|
||||
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 [
|
||||
(
|
||||
142,
|
||||
|
||||
@ -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["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)"]["fieldConfig"]["defaults"]["custom"]["drawStyle"] == "bars"
|
||||
assert panels_by_title["UPS History (Power Draw)"]["fieldConfig"]["defaults"]["custom"]["barWidthFactor"] == 0.72
|
||||
assert panels_by_title["UPS History (Power Draw)"]["options"]["legend"]["displayMode"] == "list"
|
||||
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_override_by_name = {override["matcher"]["options"]: override for override in ups_overrides}
|
||||
assert ups_override_by_name["Pyrphoros"]["properties"] == [
|
||||
{"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"] == [
|
||||
{"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"]["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[5]["color"] == "#d4b106"
|
||||
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"]["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 "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"]["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"]
|
||||
|
||||
pvc_backup_expr = panels_by_title["PVC Backup Health / Age"]["targets"][0]["expr"]
|
||||
|
||||
@ -1298,12 +1298,10 @@
|
||||
"defaults": {
|
||||
"unit": "watt",
|
||||
"custom": {
|
||||
"drawStyle": "bars",
|
||||
"barAlignment": 0,
|
||||
"barWidthFactor": 0.72,
|
||||
"lineWidth": 0,
|
||||
"fillOpacity": 55,
|
||||
"gradientMode": "none",
|
||||
"drawStyle": "line",
|
||||
"lineInterpolation": "linear",
|
||||
"lineWidth": 2,
|
||||
"fillOpacity": 18,
|
||||
"showPoints": "never",
|
||||
"spanNulls": true
|
||||
}
|
||||
@ -1321,14 +1319,6 @@
|
||||
"mode": "fixed",
|
||||
"fixedColor": "dark-blue"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "custom.barAlignment",
|
||||
"value": -1
|
||||
},
|
||||
{
|
||||
"id": "custom.barWidthFactor",
|
||||
"value": 0.42
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -1344,14 +1334,6 @@
|
||||
"mode": "fixed",
|
||||
"fixedColor": "dark-yellow"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "custom.barAlignment",
|
||||
"value": 1
|
||||
},
|
||||
{
|
||||
"id": "custom.barWidthFactor",
|
||||
"value": 0.42
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1359,7 +1341,7 @@
|
||||
},
|
||||
"options": {
|
||||
"legend": {
|
||||
"displayMode": "table",
|
||||
"displayMode": "list",
|
||||
"placement": "bottom"
|
||||
},
|
||||
"tooltip": {
|
||||
@ -1965,10 +1947,10 @@
|
||||
"overrides": []
|
||||
},
|
||||
"options": {
|
||||
"mergeValues": true,
|
||||
"showValue": "never",
|
||||
"mergeValues": false,
|
||||
"showValue": "auto",
|
||||
"legend": {
|
||||
"displayMode": "hidden",
|
||||
"displayMode": "list",
|
||||
"placement": "bottom"
|
||||
},
|
||||
"tooltip": {
|
||||
@ -2796,8 +2778,8 @@
|
||||
"overrides": []
|
||||
},
|
||||
"options": {
|
||||
"mergeValues": true,
|
||||
"showValue": "never",
|
||||
"mergeValues": false,
|
||||
"showValue": "auto",
|
||||
"legend": {
|
||||
"displayMode": "hidden",
|
||||
"placement": "bottom"
|
||||
|
||||
@ -1307,12 +1307,10 @@ data:
|
||||
"defaults": {
|
||||
"unit": "watt",
|
||||
"custom": {
|
||||
"drawStyle": "bars",
|
||||
"barAlignment": 0,
|
||||
"barWidthFactor": 0.72,
|
||||
"lineWidth": 0,
|
||||
"fillOpacity": 55,
|
||||
"gradientMode": "none",
|
||||
"drawStyle": "line",
|
||||
"lineInterpolation": "linear",
|
||||
"lineWidth": 2,
|
||||
"fillOpacity": 18,
|
||||
"showPoints": "never",
|
||||
"spanNulls": true
|
||||
}
|
||||
@ -1330,14 +1328,6 @@ data:
|
||||
"mode": "fixed",
|
||||
"fixedColor": "dark-blue"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "custom.barAlignment",
|
||||
"value": -1
|
||||
},
|
||||
{
|
||||
"id": "custom.barWidthFactor",
|
||||
"value": 0.42
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -1353,14 +1343,6 @@ data:
|
||||
"mode": "fixed",
|
||||
"fixedColor": "dark-yellow"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "custom.barAlignment",
|
||||
"value": 1
|
||||
},
|
||||
{
|
||||
"id": "custom.barWidthFactor",
|
||||
"value": 0.42
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1368,7 +1350,7 @@ data:
|
||||
},
|
||||
"options": {
|
||||
"legend": {
|
||||
"displayMode": "table",
|
||||
"displayMode": "list",
|
||||
"placement": "bottom"
|
||||
},
|
||||
"tooltip": {
|
||||
@ -1974,10 +1956,10 @@ data:
|
||||
"overrides": []
|
||||
},
|
||||
"options": {
|
||||
"mergeValues": true,
|
||||
"showValue": "never",
|
||||
"mergeValues": false,
|
||||
"showValue": "auto",
|
||||
"legend": {
|
||||
"displayMode": "hidden",
|
||||
"displayMode": "list",
|
||||
"placement": "bottom"
|
||||
},
|
||||
"tooltip": {
|
||||
@ -2805,8 +2787,8 @@ data:
|
||||
"overrides": []
|
||||
},
|
||||
"options": {
|
||||
"mergeValues": true,
|
||||
"showValue": "never",
|
||||
"mergeValues": false,
|
||||
"showValue": "auto",
|
||||
"legend": {
|
||||
"displayMode": "hidden",
|
||||
"placement": "bottom"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user