Skip to content

feat(notify): upgrade dingtalk alert notifications to actioncard and markdown with rich chinese formatting - #443

Open
Zara1024 wants to merge 8 commits into
ongridio:mainfrom
Zara1024:feat/dingtalk-alert-card
Open

Zara1024 wants to merge 8 commits into
ongridio:mainfrom
Zara1024:feat/dingtalk-alert-card

Conversation

@Zara1024

Copy link
Copy Markdown

Summary

关联 Issue

Closes #442

变更背景 (Problem)

目前系统向钉钉机器人(DingTalk Custom Bot)发送告警时,使用的是无样式的纯英文普通文本(msgtype: text),缺乏视觉层级与汉化展示,且容器缺少 8 小时时区偏差。

主要改动 (Solution)

  1. 升级为钉钉 ActionCard(独立跳转)/ Markdown 交互式卡片
  2. 告警级别与状态多色联动
  3. 自动校准 CST 北京时间(消除 8 小时偏差)
  4. 交互按钮与操作渲染
  5. 单元测试与实机验证

效果截图

DingTalk Card

Author confirmation

  • I have tested locally and all tests pass.

@Zara1024
Zara1024 requested a review from singchia as a code owner September 29, 2026 06:43
…console URL

Use structured incident status only (no subject substring), localize open/firing as OPEN, inject PublicURL as console_url in notify/retry, and deep-link DingTalk/Feishu buttons to /alerts/incidents/{id}.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Zara1024

Copy link
Copy Markdown
Author

Update

Follow-up on #442 / this PR tip 15c05ab — applied the same required correctness fixes as Feishu (#441 review):

  • Status: recovery styling depends only on structured Labels["status"]=="resolved" (no subject substring matching such as unresolved / systemd-resolved).
  • Active state: localize production status open (and legacy firing) as OPEN (发生中).
  • console_url: wire cfg.PublicURL into pipeline + retry so ActionCard buttons render in production.
  • Deep link: alert button goes to /alerts/incidents/{id}; visible incident ID on the card.

Test plan

  • go test ./internal/pkg/notify/... ./internal/manager/biz/alert -count=1
  • Live DingTalk ActionCard webhook send (errcode=0) with OPEN status + incident deep link
  • Channel test to 「钉钉机器人」 → accepted: true

@singchia PTAL — DingTalk card feature + the state/console_url fixes above are on this branch.

@Zara1024

Copy link
Copy Markdown
Author

Screenshot (follow-up)

修正后钉钉 ActionCard:status=open(subject 含 unresolved / systemd-resolved 不误判恢复)、可见事件 ID、按钮深链 /devices/{id} + /alerts/incidents/{id}。

DingTalk Card OPEN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] 钉钉告警通知升级为 ActionCard/Markdown 交互式卡片与中文汉化

1 participant