fix(ops): classify systemd runner alerts as host resources
This commit is contained in:
@@ -7,7 +7,7 @@ OpenClaw 告警規則匹配引擎
|
||||
- 規則在 YAML 定義,不需要改 Python 代碼
|
||||
- 匹配邏輯: alertname 完全匹配 > alert_type 部分匹配 > message 關鍵字
|
||||
- priority 越小越優先,999 = 通用兜底
|
||||
- 變數替換: {target} {host} {container} {instance} {job} {namespace}
|
||||
- 變數替換: {target} {host} {container} {instance} {job} {namespace} {unit}
|
||||
|
||||
自動規則生成:
|
||||
- 只有 generic_fallback 觸發時才生成(具體規則不觸發)
|
||||
@@ -185,6 +185,7 @@ def _extract_vars(alert_context: dict) -> dict[str, str]:
|
||||
host = instance.split(":")[0] if ":" in instance else instance
|
||||
job = labels.get("job", "exporter")
|
||||
namespace = alert_context.get("namespace", "awoooi-prod")
|
||||
unit = labels.get("unit", "")
|
||||
|
||||
# GAP-A4: 多層 label 查找,由最權威到最弱
|
||||
target = ""
|
||||
@@ -245,6 +246,7 @@ def _extract_vars(alert_context: dict) -> dict[str, str]:
|
||||
"instance": instance,
|
||||
"job": job,
|
||||
"namespace": namespace,
|
||||
"unit": unit,
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user