@@ -893,110 +893,121 @@ Responders: {{range .Responders}}@{{.PersonName}} {{end}}{{end}}
893893
894894``` json
895895{
896- "head" : {
897- "text" : " {{fireReason .}}INC [#{{.Num}}] {{.Title}}" ,
898- "style" : {
899- "bold" : true ,
900- "italic" : false ,
901- "color" : " {{$s := serverityToColor .IncidentSeverity}}{{$s}}"
902- }
903- },
904- "body" : [
905- {
906- "type" : " message" ,
907- "text" : {{printf "%q" (print "Channel: " .ChannelName) }},
908- "style" : {
909- "bold" : false ,
910- "italic" : false
911- }
912- },
913- {
914- "type" : " message" ,
915- "text" : " Severity: {{.IncidentSeverity}}" ,
916- "style" : {
917- "bold" : false ,
918- "italic" : false ,
919- "color" : " {{$s := serverityToColor .IncidentSeverity}}{{$s}}"
920- }
921- },
922- {
923- "type" : " message" ,
924- "text" : " {{if .AlertCnt}}Grouped alerts: {{.AlertCnt}}{{end}}" ,
925- "style" : {
926- "bold" : false ,
927- "italic" : false
928- }
929- },
930- {{if .Labels.resource }}
931- {
932- "type" : " message" ,
933- "text" : {{printf "%q" (print "Resources: " (joinAlertLabels . "resource" ", ")) }},
896+ "content" : {
897+ "head" : {
898+ "text" : " {{fireReason .}}INC [#{{.Num}}] {{.Title}}" ,
934899 "style" : {
935- "bold" : false ,
936- "italic" : false
900+ "bold" : true ,
901+ "italic" : false ,
902+ "color" : " {{$s := serverityToColor .IncidentSeverity}}{{$s}}"
937903 }
938- },
939- {{end }}{{if .Labels.body_text }}
940- {
941- "type" : " message" ,
942- "text" : {{printf "%q" (print "Description: " .Labels.body_text) }},
943- "style" : {
944- "bold" : false ,
945- "italic" : false
904+ },
905+ "body" : [
906+ {
907+ "type" : " message" ,
908+ "text" : {{printf "%q" (print "Channel: " .ChannelName) }},
909+ "style" : {
910+ "bold" : false ,
911+ "italic" : false
912+ }
913+ },
914+ {
915+ "type" : " message" ,
916+ "text" : " Severity: {{.IncidentSeverity}}" ,
917+ "style" : {
918+ "bold" : false ,
919+ "italic" : false ,
920+ "color" : " {{$s := serverityToColor .IncidentSeverity}}{{$s}}"
921+ }
946922 }
923+ {{- if .AlertCnt - }},
924+ {
925+ "type" : " message" ,
926+ "text" : " Grouped alerts: {{.AlertCnt}}" ,
927+ "style" : {
928+ "bold" : false ,
929+ "italic" : false
930+ }
931+ }
932+ {{- end - }}
933+ {{- if .Labels.resource - }},
934+ {
935+ "type" : " message" ,
936+ "text" : {{printf "%q" (print "Resources: " (joinAlertLabels . "resource" ", ")) }},
937+ "style" : {
938+ "bold" : false ,
939+ "italic" : false
940+ }
941+ }
942+ {{- end - }}
943+ {{- if .Labels.body_text - }},
944+ {
945+ "type" : " message" ,
946+ "text" : {{printf "%q" (print "Description: " .Labels.body_text) }},
947+ "style" : {
948+ "bold" : false ,
949+ "italic" : false
950+ }
951+ }
952+ {{- else if .Description - }},
953+ {
954+ "type" : " message" ,
955+ "text" : {{printf "%q" (print "Description: " .Description) }},
956+ "style" : {
957+ "bold" : false ,
958+ "italic" : false
959+ }
960+ }
961+ {{- end - }}
962+ {{- if gt (len .Responders) 0 - }},
963+ {
964+ "type" : " message" ,
965+ "text" : " Responders: {{range .Responders}}@{{.PersonName}}{{end}}" ,
966+ "style" : {
967+ "bold" : false ,
968+ "italic" : false
969+ }
970+ }
971+ {{- end - }},
972+ {
973+ "type" : " message" ,
974+ "text" : " Details: {{.DetailUrl}}" ,
975+ "style" : {
976+ "bold" : true ,
977+ "italic" : false
978+ }
979+ },
980+ {
981+ "type" : " message" ,
982+ "text" : " Ack: {{.DetailUrl}}?ack=1" ,
983+ "style" : {
984+ "bold" : true ,
985+ "italic" : false
986+ }
987+ }
988+ {{- if .IsFlapping - }},
989+ {
990+ "type" : " message" ,
991+ "text" : " 🔴 The current incident status changes frequently, notifications will be muted for {{.Flapping.MuteMinutes}} minute(s), it is recommended to optimize the alerting strategy." ,
992+ "style" : {
993+ "bold" : true ,
994+ "italic" : false
995+ }
996+ }
997+ {{- end - }}
998+ {{- if .IsInStorm - }},
999+ {
1000+ "type" : " message" ,
1001+ "text" : " 🔴 The current incident has grouped {{.AlertCnt}} alerts, triggering an alert storm, please handle it urgently!" ,
1002+ "style" : {
1003+ "bold" : true ,
1004+ "italic" : false
1005+ }
1006+ }
1007+ {{- end - }}
1008+ ]
9471009 },
948- {{else if .Description }}
949- {
950- "type" : " message" ,
951- "text" : {{printf "%q" (print "Description: " .Description) }},
952- "style" : {
953- "bold" : false ,
954- "italic" : false
955- }
956- },
957- {{end }}{{if gt (len .Responders) 0 }}
958- {
959- "type" : " message" ,
960- "text" : " Responders: {{range .Responders}}@{{.PersonName}}{{end}}" ,
961- "style" : {
962- "bold" : false ,
963- "italic" : false
964- }
965- },
966- {{end }}
967- {
968- "type" : " message" ,
969- "text" : " Details: {{.DetailUrl}}" ,
970- "style" : {
971- "bold" : true ,
972- "italic" : false
973- }
974- },
975- {
976- "type" : " message" ,
977- "text" : " Ack: {{.DetailUrl}}?ack=1" ,
978- "style" : {
979- "bold" : true ,
980- "italic" : false
981- }
982- },
983- {
984- "type" : " message" ,
985- "text" : " {{if .IsFlapping}}🔴 The current incident status changes frequently, notifications will be muted for {{.Flapping.MuteMinutes}} minute(s), it is recommended to optimize the alerting strategy.{{end}}" ,
986- "style" : {
987- "bold" : true ,
988- "italic" : false
989- }
990- },
991- {
992- "type" : " message" ,
993- "text" : " {{if .IsInStorm}}🔴 The current incident has grouped {{.AlertCnt}} alerts, triggering an alert storm, please handle it urgently!{{end}}" ,
994- "style" : {
995- "bold" : true ,
996- "italic" : false
997- }
998- }
999- ]
1010+ "is_markdown_support" : true
10001011}
10011012```
10021013</div >
0 commit comments