monitoring: tighten jobs/overview ordering

This commit is contained in:
Brad Stein 2026-01-21 15:01:02 -03:00
parent b0996e9a4f
commit db4c3b7c51
5 changed files with 87 additions and 7 deletions

View File

@ -560,6 +560,7 @@ def timeseries_panel(
grid,
*,
unit="none",
max_value=None,
legend=None,
legend_display="table",
legend_placement="bottom",
@ -584,6 +585,8 @@ def timeseries_panel(
"tooltip": {"mode": "multi"},
},
}
if max_value is not None:
panel["fieldConfig"]["defaults"]["max"] = max_value
if legend:
panel["targets"][0]["legendFormat"] = legend
if legend_calcs:
@ -742,6 +745,7 @@ def bargauge_panel(
thresholds=None,
decimals=None,
instant=False,
overrides=None,
):
"""Return a bar gauge panel with label-aware reduction."""
panel = {
@ -786,6 +790,8 @@ def bargauge_panel(
},
},
}
if overrides:
panel["fieldConfig"]["overrides"].extend(overrides)
if decimals is not None:
panel["fieldConfig"]["defaults"]["decimals"] = decimals
if links:
@ -1197,6 +1203,7 @@ def build_overview():
ARIADNE_TEST_SUCCESS_RATE,
{"h": 6, "w": 6, "x": 12, "y": 14},
unit="percent",
max_value=100,
legend=None,
legend_display="list",
)
@ -1210,6 +1217,16 @@ def build_overview():
unit="none",
instant=True,
legend="{{result}}",
overrides=[
{
"matcher": {"id": "byName", "options": "error"},
"properties": [{"id": "color", "value": {"mode": "fixed", "fixedColor": "yellow"}}],
},
{
"matcher": {"id": "byName", "options": "failed"},
"properties": [{"id": "color", "value": {"mode": "fixed", "fixedColor": "red"}}],
},
],
thresholds={
"mode": "absolute",
"steps": [
@ -2462,7 +2479,6 @@ def build_jobs_dashboard():
instant=True,
legend="{{task}}",
thresholds=recent_error_thresholds,
sort_order="asc",
decimals=2,
)
)

View File

@ -675,7 +675,7 @@
"fields": [
"Value"
],
"order": "asc"
"order": "desc"
}
}
]

View File

@ -1575,7 +1575,8 @@
],
"fieldConfig": {
"defaults": {
"unit": "percent"
"unit": "percent",
"max": 100
},
"overrides": []
},
@ -1638,7 +1639,38 @@
]
}
},
"overrides": []
"overrides": [
{
"matcher": {
"id": "byName",
"options": "error"
},
"properties": [
{
"id": "color",
"value": {
"mode": "fixed",
"fixedColor": "yellow"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "failed"
},
"properties": [
{
"id": "color",
"value": {
"mode": "fixed",
"fixedColor": "red"
}
}
]
}
]
},
"options": {
"displayMode": "gradient",

View File

@ -684,7 +684,7 @@ data:
"fields": [
"Value"
],
"order": "asc"
"order": "desc"
}
}
]

View File

@ -1584,7 +1584,8 @@ data:
],
"fieldConfig": {
"defaults": {
"unit": "percent"
"unit": "percent",
"max": 100
},
"overrides": []
},
@ -1647,7 +1648,38 @@ data:
]
}
},
"overrides": []
"overrides": [
{
"matcher": {
"id": "byName",
"options": "error"
},
"properties": [
{
"id": "color",
"value": {
"mode": "fixed",
"fixedColor": "yellow"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "failed"
},
"properties": [
{
"id": "color",
"value": {
"mode": "fixed",
"fixedColor": "red"
}
}
]
}
]
},
"options": {
"displayMode": "gradient",