From 6a62ae9947ee7e7001aff254848266f35bc6bdfd Mon Sep 17 00:00:00 2001 From: alick-liming Date: Mon, 7 Jul 2025 08:55:38 +0800 Subject: [PATCH] optimize zoom tmpl --- .../4. Configure On-call/4.7 Templates.md | 211 +++++++++--------- ...45\346\234\272\345\231\250\344\272\272.md" | 25 +-- ...32\347\237\245\346\250\241\346\235\277.md" | 211 +++++++++--------- 3 files changed, 229 insertions(+), 218 deletions(-) diff --git a/flashduty/en/1. On-call/4. Configure On-call/4.7 Templates.md b/flashduty/en/1. On-call/4. Configure On-call/4.7 Templates.md index 64bb4693..30a19499 100644 --- a/flashduty/en/1. On-call/4. Configure On-call/4.7 Templates.md +++ b/flashduty/en/1. On-call/4. Configure On-call/4.7 Templates.md @@ -893,110 +893,121 @@ Responders: {{range .Responders}}@{{.PersonName}} {{end}}{{end}} ```json { -"head": { - "text": "{{fireReason .}}INC [#{{.Num}}] {{.Title}}", - "style": { - "bold": true, - "italic": false, - "color": "{{$s := serverityToColor .IncidentSeverity}}{{$s}}" - } -}, -"body": [ - { - "type": "message", - "text": {{printf "%q" (print "Channel: " .ChannelName)}}, - "style": { - "bold": false, - "italic": false - } - }, - { - "type": "message", - "text": "Severity: {{.IncidentSeverity}}", - "style": { - "bold": false, - "italic": false, - "color": "{{$s := serverityToColor .IncidentSeverity}}{{$s}}" - } - }, - { - "type": "message", - "text": "{{if .AlertCnt}}Grouped alerts: {{.AlertCnt}}{{end}}", - "style": { - "bold": false, - "italic": false - } - }, - {{if .Labels.resource}} - { - "type": "message", - "text": {{printf "%q" (print "Resources: " (joinAlertLabels . "resource" ", "))}}, + "content": { + "head": { + "text": "{{fireReason .}}INC [#{{.Num}}] {{.Title}}", "style": { - "bold": false, - "italic": false + "bold": true, + "italic": false, + "color": "{{$s := serverityToColor .IncidentSeverity}}{{$s}}" } - }, - {{end}}{{if .Labels.body_text}} - { - "type": "message", - "text": {{printf "%q" (print "Description: " .Labels.body_text)}}, - "style": { - "bold": false, - "italic": false + }, + "body": [ + { + "type": "message", + "text": {{printf "%q" (print "Channel: " .ChannelName)}}, + "style": { + "bold": false, + "italic": false + } + }, + { + "type": "message", + "text": "Severity: {{.IncidentSeverity}}", + "style": { + "bold": false, + "italic": false, + "color": "{{$s := serverityToColor .IncidentSeverity}}{{$s}}" + } } + {{- if .AlertCnt -}}, + { + "type": "message", + "text": "Grouped alerts: {{.AlertCnt}}", + "style": { + "bold": false, + "italic": false + } + } + {{- end -}} + {{- if .Labels.resource -}}, + { + "type": "message", + "text": {{printf "%q" (print "Resources: " (joinAlertLabels . "resource" ", "))}}, + "style": { + "bold": false, + "italic": false + } + } + {{- end -}} + {{- if .Labels.body_text -}}, + { + "type": "message", + "text": {{printf "%q" (print "Description: " .Labels.body_text)}}, + "style": { + "bold": false, + "italic": false + } + } + {{- else if .Description -}}, + { + "type": "message", + "text": {{printf "%q" (print "Description: " .Description)}}, + "style": { + "bold": false, + "italic": false + } + } + {{- end -}} + {{- if gt (len .Responders) 0 -}}, + { + "type": "message", + "text": "Responders: {{range .Responders}}@{{.PersonName}}{{end}}", + "style": { + "bold": false, + "italic": false + } + } + {{- end -}}, + { + "type": "message", + "text": "Details: {{.DetailUrl}}", + "style": { + "bold": true, + "italic": false + } + }, + { + "type": "message", + "text": "Ack: {{.DetailUrl}}?ack=1", + "style": { + "bold": true, + "italic": false + } + } + {{- if .IsFlapping -}}, + { + "type": "message", + "text": "🔴 The current incident status changes frequently, notifications will be muted for {{.Flapping.MuteMinutes}} minute(s), it is recommended to optimize the alerting strategy.", + "style": { + "bold": true, + "italic": false + } + } + {{- end -}} + {{- if .IsInStorm -}}, + { + "type": "message", + "text": "🔴 The current incident has grouped {{.AlertCnt}} alerts, triggering an alert storm, please handle it urgently!", + "style": { + "bold": true, + "italic": false + } + } + {{- end -}} + ] }, - {{else if .Description}} - { - "type": "message", - "text": {{printf "%q" (print "Description: " .Description)}}, - "style": { - "bold": false, - "italic": false - } - }, - {{end}}{{if gt (len .Responders) 0}} - { - "type": "message", - "text": "Responders: {{range .Responders}}@{{.PersonName}}{{end}}", - "style": { - "bold": false, - "italic": false - } - }, - {{end}} - { - "type": "message", - "text": "Details: {{.DetailUrl}}", - "style": { - "bold": true, - "italic": false - } - }, - { - "type": "message", - "text": "Ack: {{.DetailUrl}}?ack=1", - "style": { - "bold": true, - "italic": false - } - }, - { - "type": "message", - "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}}", - "style": { - "bold": true, - "italic": false - } - }, - { - "type": "message", - "text": "{{if .IsInStorm}}🔴 The current incident has grouped {{.AlertCnt}} alerts, triggering an alert storm, please handle it urgently!{{end}}", - "style": { - "bold": true, - "italic": false - } - } -] + "is_markdown_support": true } ``` diff --git "a/flashduty/zh/1. On-call/3. \351\205\215\347\275\256\347\256\241\347\220\206/4.13 \351\200\232\347\237\245\346\234\272\345\231\250\344\272\272.md" "b/flashduty/zh/1. On-call/3. \351\205\215\347\275\256\347\256\241\347\220\206/4.13 \351\200\232\347\237\245\346\234\272\345\231\250\344\272\272.md" index 10d13017..00a20d73 100644 --- "a/flashduty/zh/1. On-call/3. \351\205\215\347\275\256\347\256\241\347\220\206/4.13 \351\200\232\347\237\245\346\234\272\345\231\250\344\272\272.md" +++ "b/flashduty/zh/1. On-call/3. \351\205\215\347\275\256\347\256\241\347\220\206/4.13 \351\200\232\347\237\245\346\234\272\345\231\250\344\272\272.md" @@ -269,24 +269,13 @@ FlashDuty 支持多种通知渠道,包括手机短信、邮件、语音通话 **配置步骤:** -1. **安装 Incoming Webhook 应用** - - 在 Zoom App 中搜索 "Incoming Webhook" - - 点击"添加"安装应用 - -2. **连接 FlashDuty** - - 在频道或 Incoming Webhook 应用中输入:`/inc connect flashduty` - - 应用将返回连接信息 - -3. **配置 Webhook 信息** - - 复制 Endpoint 中的标识符(例如:`V9S5as-zTXOSUdgMITNEwA`) - - 将其填入 FlashDuty 通知渠道的 Webhook 地址 - - 复制 Verification Token 并填入对应字段 - -4. **添加成员** - - 点击 Incoming Webhook 右上角的成员管理 - - 添加相关人员 - -> **注意:** 如需使用 @ 功能,请联系管理员 +1. 打开 Zoom 应用,进入 Add Apps,搜索并添加 Incoming Webhook 应用。 +2. 返回聊天界面,确认已成功添加“Incoming Webhook”应用。 +3. 在频道或 Incoming Webhook 应用中输入命令: +/inc connect flashduty 系统会返回应用连接信息。 +- 复制返回信息中的 Endpoint 地址(如:https://integrations.zoom.us/chat/webhooks/incomingwebhook/V9S5as-zTXOSUdgMITNEwA),将其填写到通知渠道的 Zoom 机器人 Webhook 地址或 Token 字段中。 +4. 复制返回信息中的 Verification Token,填写到通知渠道的 Zoom 机器人 Verify Token 字段中。 +5. 如需使用 @ 功能,需保证 Zoom 和 Flashduty 中的邮箱一致。管理员可在 Zoom 控制后台获取 zoom 的 user_id,并在 Flashduty 的集成中心-映射数据中创建映射表(源标签填写 email,结果标签填写 zoom_jid),最后在协作空间-分派策略中关联对应 Zoom 机器人和 映射表。 Zoom 机器人配置界面 diff --git "a/flashduty/zh/1. On-call/3. \351\205\215\347\275\256\347\256\241\347\220\206/4.7 \351\205\215\347\275\256\351\200\232\347\237\245\346\250\241\346\235\277.md" "b/flashduty/zh/1. On-call/3. \351\205\215\347\275\256\347\256\241\347\220\206/4.7 \351\205\215\347\275\256\351\200\232\347\237\245\346\250\241\346\235\277.md" index ac4c872d..111a7a7d 100644 --- "a/flashduty/zh/1. On-call/3. \351\205\215\347\275\256\347\256\241\347\220\206/4.7 \351\205\215\347\275\256\351\200\232\347\237\245\346\250\241\346\235\277.md" +++ "b/flashduty/zh/1. On-call/3. \351\205\215\347\275\256\347\256\241\347\220\206/4.7 \351\205\215\347\275\256\351\200\232\347\237\245\346\250\241\346\235\277.md" @@ -898,110 +898,121 @@ msg_type 必填,值为 post ```json { -"head": { - "text": "{{fireReason .}}INC [#{{.Num}}] {{.Title}}", - "style": { - "bold": true, - "italic": false, - "color": "{{$s := serverityToColor .IncidentSeverity}}{{$s}}" - } -}, -"body": [ - { - "type": "message", - "text": {{printf "%q" (print "协作空间:" .ChannelName)}}, - "style": { - "bold": false, - "italic": false - } - }, - { - "type": "message", - "text": "严重程度:{{.IncidentSeverity}}", - "style": { - "bold": false, - "italic": false, - "color": "{{$s := serverityToColor .IncidentSeverity}}{{$s}}" - } - }, - { - "type": "message", - "text": "{{if .AlertCnt}}聚合告警:{{.AlertCnt}}条{{end}}", - "style": { - "bold": false, - "italic": false - } - }, - {{if .Labels.resource}} - { - "type": "message", - "text": {{printf "%q" (print "告警对象:" (joinAlertLabels . "resource" ", "))}}, + "content": { + "head": { + "text": "{{fireReason .}}INC [#{{.Num}}] {{.Title}}", "style": { - "bold": false, - "italic": false + "bold": true, + "italic": false, + "color": "{{$s := serverityToColor .IncidentSeverity}}{{$s}}" } - }, - {{end}}{{if .Labels.body_text}} - { - "type": "message", - "text": {{printf "%q" (print "故障描述:" .Labels.body_text)}}, - "style": { - "bold": false, - "italic": false + }, + "body": [ + { + "type": "message", + "text": {{printf "%q" (print "协作空间:" .ChannelName)}}, + "style": { + "bold": false, + "italic": false + } + }, + { + "type": "message", + "text": "严重程度:{{.IncidentSeverity}}", + "style": { + "bold": false, + "italic": false, + "color": "{{$s := serverityToColor .IncidentSeverity}}{{$s}}" + } } + {{- if .AlertCnt -}}, + { + "type": "message", + "text": "聚合告警:{{.AlertCnt}}条", + "style": { + "bold": false, + "italic": false + } + } + {{- end -}} + {{- if .Labels.resource -}}, + { + "type": "message", + "text": {{printf "%q" (print "告警对象:" (joinAlertLabels . "resource" ", "))}}, + "style": { + "bold": false, + "italic": false + } + } + {{- end -}} + {{- if .Labels.body_text -}}, + { + "type": "message", + "text": {{printf "%q" (print "故障描述:" .Labels.body_text)}}, + "style": { + "bold": false, + "italic": false + } + } + {{- else if .Description -}}, + { + "type": "message", + "text": {{printf "%q" (print "故障描述:" .Description)}}, + "style": { + "bold": false, + "italic": false + } + } + {{- end -}} + {{- if gt (len .Responders) 0 -}}, + { + "type": "message", + "text": "处理人员:{{range .Responders}}@{{.PersonName}}{{end}}", + "style": { + "bold": false, + "italic": false + } + } + {{- end -}}, + { + "type": "message", + "text": "查看详情:{{.DetailUrl}}", + "style": { + "bold": true, + "italic": false + } + }, + { + "type": "message", + "text": "认领:{{.DetailUrl}}?ack=1", + "style": { + "bold": true, + "italic": false + } + } + {{- if .IsFlapping -}}, + { + "type": "message", + "text": "🔴 当前故障频繁发生与恢复,{{if .Flapping.MuteMinutes}}未来{{.Flapping.MuteMinutes}}分钟内此告警重复触发将不再通知。{{end}}建议您优化告警策略。", + "style": { + "bold": true, + "italic": false + } + } + {{- end -}} + {{- if .IsInStorm -}}, + { + "type": "message", + "text": "🔴 当前故障已聚合{{.AlertCnt}}条告警,触发告警风暴,请加急处理!", + "style": { + "bold": true, + "italic": false + } + } + {{- end -}} + ] }, - {{else if .Description}} - { - "type": "message", - "text": {{printf "%q" (print "故障描述:" .Description)}}, - "style": { - "bold": false, - "italic": false - } - }, - {{end}}{{if gt (len .Responders) 0}} - { - "type": "message", - "text": "处理人员:{{range .Responders}}@{{.PersonName}}{{end}}", - "style": { - "bold": false, - "italic": false - } - }, - {{end}} - { - "type": "message", - "text": "查看详情:{{.DetailUrl}}", - "style": { - "bold": true, - "italic": false - } - }, - { - "type": "message", - "text": "认领:{{.DetailUrl}}?ack=1", - "style": { - "bold": true, - "italic": false - } - }, - { - "type": "message", - "text": "{{if .IsFlapping}}🔴 当前故障频繁发生与恢复,{{if .Flapping.MuteMinutes}}未来{{.Flapping.MuteMinutes}}分钟内此告警重复触发将不再通知。{{end}}建议您优化告警策略。{{end}}", - "style": { - "bold": true, - "italic": false - } - }, - { - "type": "message", - "text": "{{if .IsInStorm}}🔴 当前故障已聚合{{.AlertCnt}}条告警,触发告警风暴,请加急处理!{{end}}", - "style": { - "bold": true, - "italic": false - } - } -] + "is_markdown_support": true } ```