feat(platform): add alert policy escalation
This commit is contained in:
@@ -879,6 +879,10 @@ func TestHandlerQualityNotificationPlan(t *testing.T) {
|
||||
if len(body.Data.Rules) == 0 || len(body.Data.Policies) == 0 || len(body.Data.PriorityIssues) == 0 {
|
||||
t.Fatalf("notification plan should include rules, policies and priority issues: %+v", body.Data)
|
||||
}
|
||||
firstPolicy := body.Data.Policies[0]
|
||||
if firstPolicy.EscalationMinutes <= 0 || firstPolicy.AcceptanceCriteria == "" {
|
||||
t.Fatalf("notification policies should expose escalation minutes and acceptance criteria: %+v", firstPolicy)
|
||||
}
|
||||
first := body.Data.PriorityIssues[0]
|
||||
if first.Priority != "P0" || first.ActionLabel == "" || first.SLA == "" || first.VehicleLabel == "" {
|
||||
t.Fatalf("priority issue should be enriched for notification: %+v", first)
|
||||
|
||||
@@ -312,10 +312,12 @@ type QualityAlertRule struct {
|
||||
}
|
||||
|
||||
type QualityNotificationPolicy struct {
|
||||
Name string `json:"name"`
|
||||
Target string `json:"target"`
|
||||
Channel string `json:"channel"`
|
||||
Condition string `json:"condition"`
|
||||
Name string `json:"name"`
|
||||
Target string `json:"target"`
|
||||
Channel string `json:"channel"`
|
||||
Condition string `json:"condition"`
|
||||
EscalationMinutes int `json:"escalationMinutes"`
|
||||
AcceptanceCriteria string `json:"acceptanceCriteria"`
|
||||
}
|
||||
|
||||
type QualityPriorityIssue struct {
|
||||
@@ -344,10 +346,10 @@ type OpsHealth struct {
|
||||
}
|
||||
|
||||
type RuntimeInfo struct {
|
||||
RequestTimeoutMs int `json:"requestTimeoutMs"`
|
||||
AMapWebJSConfigured bool `json:"amapWebJsConfigured"`
|
||||
AMapSecurityProxyEnabled bool `json:"amapSecurityProxyEnabled"`
|
||||
AMapSecurityCodeExposed bool `json:"amapSecurityCodeExposed"`
|
||||
AMapSecurityServiceHost string `json:"amapSecurityServiceHost"`
|
||||
PlatformRelease string `json:"platformRelease"`
|
||||
RequestTimeoutMs int `json:"requestTimeoutMs"`
|
||||
AMapWebJSConfigured bool `json:"amapWebJsConfigured"`
|
||||
AMapSecurityProxyEnabled bool `json:"amapSecurityProxyEnabled"`
|
||||
AMapSecurityCodeExposed bool `json:"amapSecurityCodeExposed"`
|
||||
AMapSecurityServiceHost string `json:"amapSecurityServiceHost"`
|
||||
PlatformRelease string `json:"platformRelease"`
|
||||
}
|
||||
|
||||
@@ -116,9 +116,30 @@ var qualityAlertRuleTemplates = []QualityAlertRule{
|
||||
}
|
||||
|
||||
var qualityNotificationPolicies = []QualityNotificationPolicy{
|
||||
{Name: "P0 实时中断", Target: "接入运维 + 业务责任人", Channel: "站内告警 / 邮件 / 企业微信", Condition: "无来源、VIN 缺失、存储不可写"},
|
||||
{Name: "P1 数据质量", Target: "协议解析 + 数据治理", Channel: "站内告警 / 每日汇总邮件", Condition: "字段缺失、链路间断、容量风险"},
|
||||
{Name: "P2 趋势关注", Target: "数智中心", Channel: "周报 / 趋势看板", Condition: "单源车辆、档案缺项、来源覆盖下降"},
|
||||
{
|
||||
Name: "P0 实时中断",
|
||||
Target: "接入运维 + 业务责任人",
|
||||
Channel: "站内告警 / 邮件 / 企业微信",
|
||||
Condition: "无来源、VIN 缺失、存储不可写",
|
||||
EscalationMinutes: 30,
|
||||
AcceptanceCriteria: "来源恢复并持续 10 分钟,车辆服务可查到实时与历史证据",
|
||||
},
|
||||
{
|
||||
Name: "P1 数据质量",
|
||||
Target: "协议解析 + 数据治理",
|
||||
Channel: "站内告警 / 每日汇总邮件",
|
||||
Condition: "字段缺失、链路间断、容量风险",
|
||||
EscalationMinutes: 120,
|
||||
AcceptanceCriteria: "核心字段恢复解析,影响车辆可通过 RAW 与历史证据复核",
|
||||
},
|
||||
{
|
||||
Name: "P2 趋势关注",
|
||||
Target: "数智中心",
|
||||
Channel: "周报 / 趋势看板",
|
||||
Condition: "单源车辆、档案缺项、来源覆盖下降",
|
||||
EscalationMinutes: 1440,
|
||||
AcceptanceCriteria: "趋势原因已归档,责任人和后续治理动作明确",
|
||||
},
|
||||
}
|
||||
|
||||
var qualityIssuePriorityWeight = map[string]int{
|
||||
|
||||
Reference in New Issue
Block a user