atlas dashboards: cap pod count bars at top12
This commit is contained in:
parent
596bf46863
commit
93b3c6d2ec
@ -558,7 +558,7 @@ def pie_panel(panel_id, title, expr, grid):
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def bargauge_panel(panel_id, title, expr, grid, *, unit="none", links=None):
|
def bargauge_panel(panel_id, title, expr, grid, *, unit="none", links=None, limit=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,
|
||||||
@ -603,6 +603,8 @@ def bargauge_panel(panel_id, title, expr, grid, *, unit="none", links=None):
|
|||||||
"options": {"fields": ["Value"], "order": "desc"},
|
"options": {"fields": ["Value"], "order": "desc"},
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
if limit:
|
||||||
|
panel["transformations"].append({"id": "limit", "options": {"limit": limit}})
|
||||||
return panel
|
return panel
|
||||||
|
|
||||||
|
|
||||||
@ -890,6 +892,7 @@ def build_overview():
|
|||||||
'topk(12, sum(kube_pod_info{pod!=""}) by (node))',
|
'topk(12, sum(kube_pod_info{pod!=""}) by (node))',
|
||||||
{"h": 10, "w": 12, "x": 12, "y": 54},
|
{"h": 10, "w": 12, "x": 12, "y": 54},
|
||||||
unit="none",
|
unit="none",
|
||||||
|
limit=12,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -1087,6 +1090,7 @@ def build_pods_dashboard():
|
|||||||
'topk(12, sum(kube_pod_info{pod!=""}) by (node))',
|
'topk(12, sum(kube_pod_info{pod!=""}) by (node))',
|
||||||
{"h": 8, "w": 12, "x": 0, "y": 34},
|
{"h": 8, "w": 12, "x": 0, "y": 34},
|
||||||
unit="none",
|
unit="none",
|
||||||
|
limit=12,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -1500,6 +1500,12 @@
|
|||||||
],
|
],
|
||||||
"order": "desc"
|
"order": "desc"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "limit",
|
||||||
|
"options": {
|
||||||
|
"limit": 12
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@ -483,6 +483,12 @@
|
|||||||
],
|
],
|
||||||
"order": "desc"
|
"order": "desc"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "limit",
|
||||||
|
"options": {
|
||||||
|
"limit": 12
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1509,6 +1509,12 @@ data:
|
|||||||
],
|
],
|
||||||
"order": "desc"
|
"order": "desc"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "limit",
|
||||||
|
"options": {
|
||||||
|
"limit": 12
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@ -492,6 +492,12 @@ data:
|
|||||||
],
|
],
|
||||||
"order": "desc"
|
"order": "desc"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "limit",
|
||||||
|
"options": {
|
||||||
|
"limit": 12
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user