fix(monitoring): classify host memory pressure accurately
This commit is contained in:
@@ -960,6 +960,7 @@ async def _resolve_target_from_k8s(incident: "Incident", namespace: str) -> str
|
||||
# 並加 log 便於追蹤 fallback 路徑
|
||||
_ALERTNAME_KEYWORDS: dict[str, list[str]] = {
|
||||
"HostHighCpuLoad": ["api", "web"],
|
||||
"HostMemoryUsageHigh": ["api", "web"],
|
||||
"HostOutOfMemory": ["api", "web"],
|
||||
"DockerContainerUnhealthy": [],
|
||||
"DockerContainerExited": [],
|
||||
@@ -1064,7 +1065,7 @@ async def _fetch_metrics_snapshot(incident: Incident) -> dict:
|
||||
snapshots: dict = {}
|
||||
|
||||
# 根據 alertname 選擇最相關的指標
|
||||
if alertname in ("HostHighCpuLoad", "HostOutOfMemory"):
|
||||
if alertname in ("HostHighCpuLoad", "HostMemoryUsageHigh", "HostOutOfMemory"):
|
||||
if instance:
|
||||
host = instance.split(":")[0]
|
||||
# P0 fix 2026-04-11: _instant_query 要求 dict,回傳 {"result": [...]}
|
||||
|
||||
Reference in New Issue
Block a user