fix(alerts): correct telegram execution truth
Some checks failed
CD Pipeline / tests (push) Failing after 52s
CD Pipeline / build-and-deploy (push) Has been skipped
CD Pipeline / post-deploy-checks (push) Has been skipped
Code Review / ai-code-review (push) Successful in 11s

This commit is contained in:
Your Name
2026-05-31 13:58:21 +08:00
parent 943a6feacf
commit e2ab879636
15 changed files with 624 additions and 49 deletions

View File

@@ -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():