monitoring: reorder overview stats

This commit is contained in:
Brad Stein 2025-11-17 19:49:50 -03:00
parent a1e731e929
commit 41e8a6a582
3 changed files with 156 additions and 156 deletions

View File

@ -376,9 +376,8 @@ def build_overview():
panels = []
row1_stats = [
(1, "Running pods", 'sum(kube_pod_status_phase{phase="Running"})', None, None, None),
(
2,
1,
"Workers ready",
f'sum(kube_node_status_condition{{condition="Ready",status="true",node=~"{WORKER_REGEX}"}})',
WORKER_SUFFIX,
@ -386,7 +385,7 @@ def build_overview():
None,
),
(
3,
2,
"Control plane ready",
f'sum(kube_node_status_condition{{condition="Ready",status="true",node=~"{CONTROL_REGEX}"}})',
CONTROL_SUFFIX,
@ -394,7 +393,7 @@ def build_overview():
None,
),
(
4,
3,
"Control plane workloads",
f'sum(kube_pod_info{{node=~"{CONTROL_REGEX}",namespace!~"{CP_ALLOWED_NS}"}})',
None,
@ -402,7 +401,7 @@ def build_overview():
link_to("atlas-pods"),
),
(
5,
4,
"Problem pods",
PROBLEM_PODS_EXPR,
None,
@ -410,17 +409,18 @@ def build_overview():
link_to("atlas-pods"),
),
(
6,
5,
"Stuck terminating",
STUCK_TERMINATING_EXPR,
None,
1,
link_to("atlas-pods"),
),
(6, "Running pods", 'sum(kube_pod_status_phase{phase="Running"})', None, None, None),
]
for idx, (panel_id, title, expr, suffix, ok_value, links) in enumerate(row1_stats):
thresholds = None
if panel_id == 2:
if panel_id == 1:
thresholds = {
"mode": "absolute",
"steps": [
@ -430,7 +430,7 @@ def build_overview():
{"color": "green", "value": WORKER_TOTAL},
],
}
elif panel_id == 3:
elif panel_id == 2:
thresholds = {
"mode": "absolute",
"steps": [
@ -438,7 +438,7 @@ def build_overview():
{"color": "green", "value": CONTROL_TOTAL},
],
}
elif panel_id in (4, 5, 6):
elif panel_id in (3, 4, 5):
thresholds = {
"mode": "absolute",
"steps": [
@ -475,7 +475,7 @@ def build_overview():
{"h": 5, "w": 6, "x": 6 * idx, "y": 5},
unit=unit,
thresholds=PERCENT_THRESHOLDS if unit == "percent" else None,
text_mode="value_and_name",
text_mode="name_and_value",
legend="{{node}}",
instant=True,
links=link_to("atlas-nodes"),

View File

@ -10,66 +10,6 @@
{
"id": 1,
"type": "stat",
"title": "Running pods",
"datasource": {
"type": "prometheus",
"uid": "atlas-vm"
},
"gridPos": {
"h": 5,
"w": 4,
"x": 0,
"y": 0
},
"targets": [
{
"expr": "sum(kube_pod_status_phase{phase=\"Running\"})",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "rgba(115, 115, 115, 1)",
"value": null
},
{
"color": "green",
"value": 1
}
]
},
"unit": "none",
"custom": {
"displayMode": "auto"
}
},
"overrides": []
},
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "center",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "value"
}
},
{
"id": 2,
"type": "stat",
"title": "Workers ready",
"datasource": {
"type": "prometheus",
@ -78,7 +18,7 @@
"gridPos": {
"h": 5,
"w": 4,
"x": 4,
"x": 0,
"y": 0
},
"targets": [
@ -137,7 +77,7 @@
}
},
{
"id": 3,
"id": 2,
"type": "stat",
"title": "Control plane ready",
"datasource": {
@ -147,7 +87,7 @@
"gridPos": {
"h": 5,
"w": 4,
"x": 8,
"x": 4,
"y": 0
},
"targets": [
@ -198,7 +138,7 @@
}
},
{
"id": 4,
"id": 3,
"type": "stat",
"title": "Control plane workloads",
"datasource": {
@ -208,7 +148,7 @@
"gridPos": {
"h": 5,
"w": 4,
"x": 12,
"x": 8,
"y": 0
},
"targets": [
@ -273,7 +213,7 @@
]
},
{
"id": 5,
"id": 4,
"type": "stat",
"title": "Problem pods",
"datasource": {
@ -283,7 +223,7 @@
"gridPos": {
"h": 5,
"w": 4,
"x": 16,
"x": 12,
"y": 0
},
"targets": [
@ -348,7 +288,7 @@
]
},
{
"id": 6,
"id": 5,
"type": "stat",
"title": "Stuck terminating",
"datasource": {
@ -358,7 +298,7 @@
"gridPos": {
"h": 5,
"w": 4,
"x": 20,
"x": 16,
"y": 0
},
"targets": [
@ -422,6 +362,66 @@
}
]
},
{
"id": 6,
"type": "stat",
"title": "Running pods",
"datasource": {
"type": "prometheus",
"uid": "atlas-vm"
},
"gridPos": {
"h": 5,
"w": 4,
"x": 20,
"y": 0
},
"targets": [
{
"expr": "sum(kube_pod_status_phase{phase=\"Running\"})",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "rgba(115, 115, 115, 1)",
"value": null
},
{
"color": "green",
"value": 1
}
]
},
"unit": "none",
"custom": {
"displayMode": "auto"
}
},
"overrides": []
},
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "center",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "value"
}
},
{
"id": 7,
"type": "stat",
@ -485,7 +485,7 @@
"fields": "",
"values": false
},
"textMode": "value_and_name"
"textMode": "name_and_value"
},
"links": [
{
@ -558,7 +558,7 @@
"fields": "",
"values": false
},
"textMode": "value_and_name"
"textMode": "name_and_value"
},
"links": [
{
@ -627,7 +627,7 @@
"fields": "",
"values": false
},
"textMode": "value_and_name"
"textMode": "name_and_value"
},
"links": [
{
@ -696,7 +696,7 @@
"fields": "",
"values": false
},
"textMode": "value_and_name"
"textMode": "name_and_value"
},
"links": [
{

View File

@ -19,66 +19,6 @@ data:
{
"id": 1,
"type": "stat",
"title": "Running pods",
"datasource": {
"type": "prometheus",
"uid": "atlas-vm"
},
"gridPos": {
"h": 5,
"w": 4,
"x": 0,
"y": 0
},
"targets": [
{
"expr": "sum(kube_pod_status_phase{phase=\"Running\"})",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "rgba(115, 115, 115, 1)",
"value": null
},
{
"color": "green",
"value": 1
}
]
},
"unit": "none",
"custom": {
"displayMode": "auto"
}
},
"overrides": []
},
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "center",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "value"
}
},
{
"id": 2,
"type": "stat",
"title": "Workers ready",
"datasource": {
"type": "prometheus",
@ -87,7 +27,7 @@ data:
"gridPos": {
"h": 5,
"w": 4,
"x": 4,
"x": 0,
"y": 0
},
"targets": [
@ -146,7 +86,7 @@ data:
}
},
{
"id": 3,
"id": 2,
"type": "stat",
"title": "Control plane ready",
"datasource": {
@ -156,7 +96,7 @@ data:
"gridPos": {
"h": 5,
"w": 4,
"x": 8,
"x": 4,
"y": 0
},
"targets": [
@ -207,7 +147,7 @@ data:
}
},
{
"id": 4,
"id": 3,
"type": "stat",
"title": "Control plane workloads",
"datasource": {
@ -217,7 +157,7 @@ data:
"gridPos": {
"h": 5,
"w": 4,
"x": 12,
"x": 8,
"y": 0
},
"targets": [
@ -282,7 +222,7 @@ data:
]
},
{
"id": 5,
"id": 4,
"type": "stat",
"title": "Problem pods",
"datasource": {
@ -292,7 +232,7 @@ data:
"gridPos": {
"h": 5,
"w": 4,
"x": 16,
"x": 12,
"y": 0
},
"targets": [
@ -357,7 +297,7 @@ data:
]
},
{
"id": 6,
"id": 5,
"type": "stat",
"title": "Stuck terminating",
"datasource": {
@ -367,7 +307,7 @@ data:
"gridPos": {
"h": 5,
"w": 4,
"x": 20,
"x": 16,
"y": 0
},
"targets": [
@ -431,6 +371,66 @@ data:
}
]
},
{
"id": 6,
"type": "stat",
"title": "Running pods",
"datasource": {
"type": "prometheus",
"uid": "atlas-vm"
},
"gridPos": {
"h": 5,
"w": 4,
"x": 20,
"y": 0
},
"targets": [
{
"expr": "sum(kube_pod_status_phase{phase=\"Running\"})",
"refId": "A"
}
],
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "rgba(115, 115, 115, 1)",
"value": null
},
{
"color": "green",
"value": 1
}
]
},
"unit": "none",
"custom": {
"displayMode": "auto"
}
},
"overrides": []
},
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "center",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "value"
}
},
{
"id": 7,
"type": "stat",
@ -494,7 +494,7 @@ data:
"fields": "",
"values": false
},
"textMode": "value_and_name"
"textMode": "name_and_value"
},
"links": [
{
@ -567,7 +567,7 @@ data:
"fields": "",
"values": false
},
"textMode": "value_and_name"
"textMode": "name_and_value"
},
"links": [
{
@ -636,7 +636,7 @@ data:
"fields": "",
"values": false
},
"textMode": "value_and_name"
"textMode": "name_and_value"
},
"links": [
{
@ -705,7 +705,7 @@ data:
"fields": "",
"values": false
},
"textMode": "value_and_name"
"textMode": "name_and_value"
},
"links": [
{