fix(alerts): correct telegram execution truth
This commit is contained in:
@@ -298,6 +298,12 @@ def _matches(rule: dict, alertname: str, alert_type: str, message: str, instance
|
||||
if alertnames and alertname in alertnames:
|
||||
return True
|
||||
|
||||
# 2026-05-31 ogt + Codex: 有明確 alertname 的規則不得只靠寬鬆 message
|
||||
# keyword 命中,否則 HostPreviousBootStorageErrorsDetected 這類主機 storage
|
||||
# 告警會誤配到 minio_disk_high。
|
||||
if alertnames and alertname and alertname != "custom":
|
||||
return False
|
||||
|
||||
# alert_type 部分匹配
|
||||
for kw in match.get("alert_type", []):
|
||||
if kw.lower() in alert_type.lower():
|
||||
|
||||
Reference in New Issue
Block a user