fix(adr075): 修補斷點E — _push_to_telegram_background 補 TYPE-8M routing
Some checks failed
CD Pipeline / build-and-deploy (push) Has been cancelled

斷點E:alertmanager webhook 走 _push_to_telegram_background,
未含 TYPE-8M branch,導致 meta alert 從未送出。

- webhooks.py: 新增 alert_category 參數 + TYPE-8M branch
- incident_service.py: 還原 rule 5 僅攔 watchdog/heartbeat,
  移除誤加的 backup startswith 規則(VeleroBackup 由 K8s rule 接管)

Tests: 52/52 passed

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
OG T
2026-04-12 20:01:51 +08:00
parent 1f7975170a
commit f25d82a88a
2 changed files with 28 additions and 8 deletions

View File

@@ -164,14 +164,8 @@ def classify_alert_early(alertname: str, severity: str, labels: dict | None = No
return "info", "TYPE-1"
# 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
):
# VeleroBackup 由 K8s prefix 規則接管,此處只攔 watchdog/heartbeat
if "watchdog" in alertname_lower or alertname == "Heartbeat":
return "backup", "TYPE-1"
# 6. 主機資源(從 infrastructure 分離ADR-075 統帥決議)