atlas dashboards: show pod counts with top12 bars
This commit is contained in:
parent
9e76277c22
commit
b770575b42
@ -558,7 +558,18 @@ def pie_panel(panel_id, title, expr, grid):
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def bargauge_panel(panel_id, title, expr, grid, *, unit="none", links=None, limit=None):
|
def bargauge_panel(
|
||||||
|
panel_id,
|
||||||
|
title,
|
||||||
|
expr,
|
||||||
|
grid,
|
||||||
|
*,
|
||||||
|
unit="none",
|
||||||
|
links=None,
|
||||||
|
limit=None,
|
||||||
|
thresholds=None,
|
||||||
|
decimals=None,
|
||||||
|
):
|
||||||
"""Return a bar gauge panel with label-aware reduction."""
|
"""Return a bar gauge panel with label-aware reduction."""
|
||||||
panel = {
|
panel = {
|
||||||
"id": panel_id,
|
"id": panel_id,
|
||||||
@ -572,7 +583,8 @@ def bargauge_panel(panel_id, title, expr, grid, *, unit="none", links=None, limi
|
|||||||
"unit": unit,
|
"unit": unit,
|
||||||
"min": 0,
|
"min": 0,
|
||||||
"max": 100 if unit == "percent" else None,
|
"max": 100 if unit == "percent" else None,
|
||||||
"thresholds": {
|
"thresholds": thresholds
|
||||||
|
or {
|
||||||
"mode": "absolute",
|
"mode": "absolute",
|
||||||
"steps": [
|
"steps": [
|
||||||
{"color": "green", "value": None},
|
{"color": "green", "value": None},
|
||||||
@ -594,6 +606,8 @@ def bargauge_panel(panel_id, title, expr, grid, *, unit="none", links=None, limi
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
if decimals is not None:
|
||||||
|
panel["fieldConfig"]["defaults"]["decimals"] = decimals
|
||||||
if links:
|
if links:
|
||||||
panel["links"] = links
|
panel["links"] = links
|
||||||
# Keep bars ordered by value descending for readability.
|
# Keep bars ordered by value descending for readability.
|
||||||
@ -893,6 +907,16 @@ def build_overview():
|
|||||||
{"h": 10, "w": 12, "x": 12, "y": 54},
|
{"h": 10, "w": 12, "x": 12, "y": 54},
|
||||||
unit="none",
|
unit="none",
|
||||||
limit=12,
|
limit=12,
|
||||||
|
decimals=0,
|
||||||
|
thresholds={
|
||||||
|
"mode": "absolute",
|
||||||
|
"steps": [
|
||||||
|
{"color": "green", "value": None},
|
||||||
|
{"color": "yellow", "value": 50},
|
||||||
|
{"color": "orange", "value": 75},
|
||||||
|
{"color": "red", "value": 100},
|
||||||
|
],
|
||||||
|
},
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -1091,6 +1115,16 @@ def build_pods_dashboard():
|
|||||||
{"h": 8, "w": 12, "x": 0, "y": 34},
|
{"h": 8, "w": 12, "x": 0, "y": 34},
|
||||||
unit="none",
|
unit="none",
|
||||||
limit=12,
|
limit=12,
|
||||||
|
decimals=0,
|
||||||
|
thresholds={
|
||||||
|
"mode": "absolute",
|
||||||
|
"steps": [
|
||||||
|
{"color": "green", "value": None},
|
||||||
|
{"color": "yellow", "value": 50},
|
||||||
|
{"color": "orange", "value": 75},
|
||||||
|
{"color": "red", "value": 100},
|
||||||
|
],
|
||||||
|
},
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -1469,14 +1469,15 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"color": "orange",
|
"color": "orange",
|
||||||
"value": 70
|
"value": 75
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"color": "red",
|
"color": "red",
|
||||||
"value": 85
|
"value": 100
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
"decimals": 0
|
||||||
},
|
},
|
||||||
"overrides": []
|
"overrides": []
|
||||||
},
|
},
|
||||||
|
|||||||
@ -452,14 +452,15 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"color": "orange",
|
"color": "orange",
|
||||||
"value": 70
|
"value": 75
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"color": "red",
|
"color": "red",
|
||||||
"value": 85
|
"value": 100
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
"decimals": 0
|
||||||
},
|
},
|
||||||
"overrides": []
|
"overrides": []
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1478,14 +1478,15 @@ data:
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"color": "orange",
|
"color": "orange",
|
||||||
"value": 70
|
"value": 75
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"color": "red",
|
"color": "red",
|
||||||
"value": 85
|
"value": 100
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
"decimals": 0
|
||||||
},
|
},
|
||||||
"overrides": []
|
"overrides": []
|
||||||
},
|
},
|
||||||
|
|||||||
@ -461,14 +461,15 @@ data:
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"color": "orange",
|
"color": "orange",
|
||||||
"value": 70
|
"value": 75
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"color": "red",
|
"color": "red",
|
||||||
"value": 85
|
"value": 100
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
"decimals": 0
|
||||||
},
|
},
|
||||||
"overrides": []
|
"overrides": []
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user