Remove filter bar from namespace plurality table

This commit is contained in:
Brad Stein 2025-12-13 17:38:57 -03:00
parent c536a13d55
commit a4b3273bab
3 changed files with 7 additions and 23 deletions

View File

@ -1192,20 +1192,20 @@ def build_pods_dashboard():
f"{share_expr} == bool on(namespace) group_left() " f"{share_expr} == bool on(namespace) group_left() "
f"(max by (namespace) ({share_expr}))" f"(max by (namespace) ({share_expr}))"
) )
nonzero_expr = f"{share_expr} > bool 0"
panels.append( panels.append(
table_panel( table_panel(
10, 10,
"Namespace Plurality by Node v18", "Namespace Plurality by Node v19",
( (
f"{share_expr} * on(namespace,node) group_left() " f"{share_expr} * on(namespace,node) group_left() "
f"({mask_expr})" f"({mask_expr}) * on(namespace,node) group_left() ({nonzero_expr})"
), ),
{"h": 8, "w": 24, "x": 0, "y": 42}, {"h": 8, "w": 24, "x": 0, "y": 42},
unit="percent", unit="percent",
transformations=[ transformations=[
{"id": "labelsToFields", "options": {}}, {"id": "labelsToFields", "options": {}},
{"id": "organize", "options": {"excludeByName": {"Time": True}}}, {"id": "organize", "options": {"excludeByName": {"Time": True}}},
{"id": "filterByValue", "options": {"match": "Value", "operator": "gt", "value": 0}},
{"id": "sortBy", "options": {"fields": ["node", "Value"], "order": "asc"}}, {"id": "sortBy", "options": {"fields": ["node", "Value"], "order": "asc"}},
], ],
instant=True, instant=True,

View File

@ -498,7 +498,7 @@
{ {
"id": 10, "id": 10,
"type": "table", "type": "table",
"title": "Namespace Plurality by Node v18", "title": "Namespace Plurality by Node v19",
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "atlas-vm" "uid": "atlas-vm"
@ -511,7 +511,7 @@
}, },
"targets": [ "targets": [
{ {
"expr": "(sum by (namespace,node) (kube_pod_info{pod!=\"\"}) / on(namespace) group_left() clamp_min(sum by (namespace) (kube_pod_info{pod!=\"\"}), 1) * 100) * on(namespace,node) group_left() ((sum by (namespace,node) (kube_pod_info{pod!=\"\"}) / on(namespace) group_left() clamp_min(sum by (namespace) (kube_pod_info{pod!=\"\"}), 1) * 100) == bool on(namespace) group_left() (max by (namespace) ((sum by (namespace,node) (kube_pod_info{pod!=\"\"}) / on(namespace) group_left() clamp_min(sum by (namespace) (kube_pod_info{pod!=\"\"}), 1) * 100))))", "expr": "(sum by (namespace,node) (kube_pod_info{pod!=\"\"}) / on(namespace) group_left() clamp_min(sum by (namespace) (kube_pod_info{pod!=\"\"}), 1) * 100) * on(namespace,node) group_left() ((sum by (namespace,node) (kube_pod_info{pod!=\"\"}) / on(namespace) group_left() clamp_min(sum by (namespace) (kube_pod_info{pod!=\"\"}), 1) * 100) == bool on(namespace) group_left() (max by (namespace) ((sum by (namespace,node) (kube_pod_info{pod!=\"\"}) / on(namespace) group_left() clamp_min(sum by (namespace) (kube_pod_info{pod!=\"\"}), 1) * 100)))) * on(namespace,node) group_left() ((sum by (namespace,node) (kube_pod_info{pod!=\"\"}) / on(namespace) group_left() clamp_min(sum by (namespace) (kube_pod_info{pod!=\"\"}), 1) * 100) > bool 0)",
"refId": "A", "refId": "A",
"instant": true "instant": true
} }
@ -540,14 +540,6 @@
} }
} }
}, },
{
"id": "filterByValue",
"options": {
"match": "Value",
"operator": "gt",
"value": 0
}
},
{ {
"id": "sortBy", "id": "sortBy",
"options": { "options": {

View File

@ -507,7 +507,7 @@ data:
{ {
"id": 10, "id": 10,
"type": "table", "type": "table",
"title": "Namespace Plurality by Node v18", "title": "Namespace Plurality by Node v19",
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "atlas-vm" "uid": "atlas-vm"
@ -520,7 +520,7 @@ data:
}, },
"targets": [ "targets": [
{ {
"expr": "(sum by (namespace,node) (kube_pod_info{pod!=\"\"}) / on(namespace) group_left() clamp_min(sum by (namespace) (kube_pod_info{pod!=\"\"}), 1) * 100) * on(namespace,node) group_left() ((sum by (namespace,node) (kube_pod_info{pod!=\"\"}) / on(namespace) group_left() clamp_min(sum by (namespace) (kube_pod_info{pod!=\"\"}), 1) * 100) == bool on(namespace) group_left() (max by (namespace) ((sum by (namespace,node) (kube_pod_info{pod!=\"\"}) / on(namespace) group_left() clamp_min(sum by (namespace) (kube_pod_info{pod!=\"\"}), 1) * 100))))", "expr": "(sum by (namespace,node) (kube_pod_info{pod!=\"\"}) / on(namespace) group_left() clamp_min(sum by (namespace) (kube_pod_info{pod!=\"\"}), 1) * 100) * on(namespace,node) group_left() ((sum by (namespace,node) (kube_pod_info{pod!=\"\"}) / on(namespace) group_left() clamp_min(sum by (namespace) (kube_pod_info{pod!=\"\"}), 1) * 100) == bool on(namespace) group_left() (max by (namespace) ((sum by (namespace,node) (kube_pod_info{pod!=\"\"}) / on(namespace) group_left() clamp_min(sum by (namespace) (kube_pod_info{pod!=\"\"}), 1) * 100)))) * on(namespace,node) group_left() ((sum by (namespace,node) (kube_pod_info{pod!=\"\"}) / on(namespace) group_left() clamp_min(sum by (namespace) (kube_pod_info{pod!=\"\"}), 1) * 100) > bool 0)",
"refId": "A", "refId": "A",
"instant": true "instant": true
} }
@ -549,14 +549,6 @@ data:
} }
} }
}, },
{
"id": "filterByValue",
"options": {
"match": "Value",
"operator": "gt",
"value": 0
}
},
{ {
"id": "sortBy", "id": "sortBy",
"options": { "options": {