#4346·hertzbeat

[Feature] Add Microsoft Teams as an alert notification channel

Author: RangshCreated Aug 24, 2026Updated Aug 24, 2026
Labelsnew feature

Feature Request

希望为 HertzBeat 增加 Microsoft Teams 作为告警通知渠道。

我已检索文档、现有 Issues / PRs 和代码:目前没有 Teams / msteams 相关提案或实现。项目已有 Slack、Discord、Webhook、Ntfy 等渠道。#3778 / #4249 只修了通用 Webhook 对 Power Automate URL 的编码问题,并不是 Teams 渠道。

Office 365 Incoming Webhook 已于 2026-05 退役,新实现应对接 Teams Workflows(Power Automate)webhook,发送 Adaptive Card,而不是已下线的 webhook.office.com Incoming Webhook。

如果社区认可,我愿意实现并提交 PR。开始写代码前,想请维护者确认是否接受做成独立通知渠道。

Is your feature request related to a problem? Please describe

很多企业把告警放在 Teams 频道。现在只能用通用 Webhook 自己拼 JSON,没有 Adaptive Card、严重级别颜色,也没有帮助文档。已经在用 Teams Workflows 的用户,希望在「新增接收人」里能直接选择 Microsoft Teams。

Describe the solution you'd like

参考现有 Slack / Ntfy,新增独立通知类型:

  1. 在 alerter 新增 Teams Handler(建议 type = 16)
  2. 接收人只需要 Workflows webhook URL;字段长度至少 1000
  3. HTTP 发送必须走 java.net.URI,避免 Power Automate 查询参数被二次编码(同 #4249)
  4. 默认把告警渲染成 Adaptive Card(按 severity 上色)
  5. 前端表单、i18n、默认模板、中英文帮助文档
  6. Handler 单元测试(成功 / 非 2xx / URL 校验 / URI 原样发送)

第一版不引入 Graph API / Bot OAuth。

Describe alternatives you've considered

  1. 仅在文档中说明用 Webhook 对接 Power Automate:能用,但对用户不够友好,也没有 Adaptive Card。
  2. 复用 Slack 渠道:URL 域名校验写死 hooks.slack.com,且字段长度只有 300,不能复用。

Additional context

请维护者帮忙确认:

  • 是否欢迎做成独立通知渠道?
  • 第一版是否只支持 Workflows webhook + Adaptive Card?
  • 是否更建议只在文档里写 Webhook 对接方式?

如果方向 OK,我来实现并提交 PR。谢谢。