fix(monitoring): classify host memory pressure accurately
This commit is contained in:
@@ -103,6 +103,10 @@ class TestInfrastructure:
|
||||
assert ac == "host_resource"
|
||||
|
||||
def test_host_memory(self):
|
||||
ac, nt = classify_alert_early("HostMemoryUsageHigh", "warning", {})
|
||||
assert ac == "host_resource"
|
||||
|
||||
def test_historical_host_out_of_memory_alias(self):
|
||||
ac, nt = classify_alert_early("HostOutOfMemory", "warning", {})
|
||||
assert ac == "host_resource"
|
||||
|
||||
|
||||
@@ -21,6 +21,11 @@ class TestGetIncidentTypeStaticFallback:
|
||||
result = get_incident_type("HostHighCpuLoad")
|
||||
assert result == "host_cpu"
|
||||
|
||||
@pytest.mark.parametrize("alertname", ["HostMemoryUsageHigh", "HostOutOfMemory"])
|
||||
def test_memory_pressure_taxonomy_and_historical_alias(self, alertname):
|
||||
"""新記憶體壓力名稱與歷史事件 alias 都維持 host_memory。"""
|
||||
assert get_incident_type(alertname) == "host_memory"
|
||||
|
||||
def test_known_alertname_k8s(self):
|
||||
"""KubePodCrashLooping → k8s_pod_crash"""
|
||||
result = get_incident_type("KubePodCrashLooping")
|
||||
|
||||
Reference in New Issue
Block a user