{
"msg_type": "post",
"post": {
"zh_cn": {
"title": "{{if eq .IncidentSeverity "Critical"}}🔴{{else if eq .IncidentSeverity "Warning"}}⚠️{{else}}ℹ️{{end}} {{fireReason .}}INC #{{.Num}} {{toHtml .Title}}",
"content": [
[{
"tag": "text",
"text": "🏢 "
}, {
"tag": "text",
"text": "协作空间:",
"style": ["bold"]
}, {
"tag": "text",
"text": "{{if .ChannelName}}{{.ChannelName}}{{else}}无{{end}}"
}],
[{
"tag": "text",
"text": "{{if eq .IncidentSeverity "Critical"}}🔴{{else if eq .IncidentSeverity "Warning"}}⚠️{{else}}ℹ️{{end}} "
}, {
"tag": "text",
"text": "严重程度:",
"style": ["bold"]
}, {
"tag": "text",
"text": "{{.IncidentSeverity}}"
}],
[{
"tag": "text",
"text": "⏰ "
}, {
"tag": "text",
"text": "触发时间:",
"style": ["bold"]
}, {
"tag": "text",
"text": "{{date "2006-01-02 15:04:05" .StartTime}}"
}],
{{if gt .AlertCnt 1}}[{
"tag": "text",
"text": "🔔 "
}, {
"tag": "text",
"text": "聚合告警:",
"style": ["bold"]
}, {
"tag": "text",
"text": "{{.AlertCnt}}条"
}],{{end}}
{{if .Labels.resource}}[{
"tag": "text",
"text": "📋 "
}, {
"tag": "text",
"text": "告警对象:",
"style": ["bold"]
}, {
"tag": "text",
"text": {{printf "%q" (print (joinAlertLabels . "resource" ","))}}
}],{{end}}
{{if .Description}}[{
"tag": "text",
"text": "📝 "
}, {
"tag": "text",
"text": "描述:",
"style": ["bold"]
}, {
"tag": "text",
"text": {{printf "%q" (print .Description)}}
}],{{end}}
{{if gt (len .Responders) 0}}[{
"tag": "text",
"text": "👨💻 "
}, {
"tag": "text",
"text": "处理人员:",
"style": ["bold"]
}, {
"tag": "text",
"text": "{{range .Responders}}@{{.PersonName}} {{end}}"
}],{{end}}
[{
"tag": "a",
"href": "{{.DetailUrl}}",
"text": "故障详情"
},{
"tag": "text",
"text": " "
},{
"tag": "a",
"href": "{{.DetailUrl}}?ack=1",
"text": "认领"
}]
{{if or .IsFlapping .IsInStorm}},{{end}}
{{if .IsFlapping}}
[{
"tag": "text",
"text": "\n 🔴 当前故障频繁发生与恢复,{{if .Flapping.MuteMinutes}}未来{{.Flapping.MuteMinutes}}分钟内此告警重复触发将不再通知。{{end}}建议您优化告警策略。"
}]
{{end}}
{{if and .IsFlapping .IsInStorm}},{{end}}
{{if .IsInStorm}}
,[{
"tag": "text",
"text": "\n 🔴 当前故障已聚合{{.AlertCnt}}条告警,触发告警风暴,请加急处理!"
}]
{{end}}
]
}
}
}