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

View File

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

View File

@ -1575,7 +1575,8 @@
], ],
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"unit": "percent" "unit": "percent",
"max": 100
}, },
"overrides": [] "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": { "options": {
"displayMode": "gradient", "displayMode": "gradient",

View File

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

View File

@ -1584,7 +1584,8 @@ data:
], ],
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"unit": "percent" "unit": "percent",
"max": 100
}, },
"overrides": [] "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": { "options": {
"displayMode": "gradient", "displayMode": "gradient",