FIX(grafana): change OOM panel to stat type

- Replace timeseries with stat panel for OOM detection
- Show total count of OOMKilled pods instead of timeline
- Gauge metric not suitable for timeseries visualization
This commit is contained in:
2026-01-09 15:24:48 +09:00
parent 7cd778313a
commit 01c5742d7a

View File

@@ -2353,45 +2353,11 @@
"type": "prometheus",
"uid": "${datasource}"
},
"description": "No data is generally a good thing here.",
"description": "Pods that were OOM killed (based on lastState).",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "points",
"fillOpacity": 25,
"gradientMode": "opacity",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "smooth",
"lineWidth": 2,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"showValues": false,
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
@@ -2399,11 +2365,15 @@
"steps": [
{
"color": "green",
"value": 0
"value": null
},
{
"color": "yellow",
"value": 1
},
{
"color": "red",
"value": 80
"value": 3
}
]
},
@@ -2419,23 +2389,18 @@
},
"id": 87,
"options": {
"legend": {
"calcs": [
"min",
"max",
"mean"
],
"displayMode": "table",
"placement": "right",
"showLegend": true,
"sortBy": "Max",
"sortDesc": true
"colorMode": "value",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": ["lastNotNull"],
"fields": "",
"values": false
},
"tooltip": {
"hideZeros": false,
"mode": "multi",
"sort": "none"
}
"showPercentChange": false,
"textMode": "auto",
"wideLayout": true
},
"pluginVersion": "12.3.1",
"targets": [
@@ -2445,16 +2410,14 @@
"uid": "${datasource}"
},
"editorMode": "code",
"exemplar": true,
"expr": "count by (namespace) (kube_pod_container_status_last_terminated_reason{cluster=\"$cluster\", reason=\"OOMKilled\"} == 1) or vector(0)",
"interval": "",
"legendFormat": "{{ namespace }}",
"range": true,
"expr": "count(kube_pod_container_status_last_terminated_reason{cluster=\"$cluster\", reason=\"OOMKilled\"} == 1)",
"instant": true,
"legendFormat": "OOMKilled Pods",
"refId": "A"
}
],
"title": "OOM Events by namespace",
"type": "timeseries"
"title": "OOMKilled Pods",
"type": "stat"
},
{
"datasource": {