fix(classify): HostBackupFailed 補入 backup/TYPE-1 規則
Some checks failed
CD Pipeline / build-and-deploy (push) Failing after 1m51s
Some checks failed
CD Pipeline / build-and-deploy (push) Failing after 1m51s
classify_alert_early() 的 backup 規則只攔 watchdog/Heartbeat, HostBackupFailed 先被 Host prefix 規則攔走 → host_resource/TYPE-3 → 跑 LLM → 審批卡。 修法:在 Host prefix 前新增 backup 關鍵字/前綴攔截: - HostBackup* / Backup* / VeleroBackup* / BackupRestore* - alertname 含 "backup"(大小寫不敏感) 影響:所有備份相關告警直接走 TYPE-1 info 通知,不進 LLM。 HostHighCpu / HostDown 等非備份的 Host 告警不受影響。 2026-04-12 ogt Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -163,8 +163,15 @@ def classify_alert_early(alertname: str, severity: str, labels: dict | None = No
|
||||
if severity in ("info", "none"):
|
||||
return "info", "TYPE-1"
|
||||
|
||||
# 5. Backup / Heartbeat(Velero 已由 K8s prefix 規則接管)
|
||||
if "watchdog" in alertname_lower or alertname == "Heartbeat":
|
||||
# 5. Backup / Heartbeat — 純資訊,不進 LLM
|
||||
# HostBackupFailed 必須在 Host prefix 前攔截,否則被歸 host_resource/TYPE-3
|
||||
# 2026-04-12 ogt: 補充 HostBackup/Backup/VeleroBackup 前綴
|
||||
if (
|
||||
"watchdog" in alertname_lower
|
||||
or alertname == "Heartbeat"
|
||||
or alertname.startswith(("HostBackup", "Backup", "VeleroBackup", "BackupRestore"))
|
||||
or "backup" in alertname_lower
|
||||
):
|
||||
return "backup", "TYPE-1"
|
||||
|
||||
# 6. 主機資源(從 infrastructure 分離,ADR-075 統帥決議)
|
||||
|
||||
Reference in New Issue
Block a user