nightingale1/etc/template
Ulric Qin 5332f797a6 add alert duration in wecom.tpl 2022-10-30 17:11:51 +08:00
..
README.md support graph url (#1088) 2022-08-06 18:12:33 +08:00
dingtalk.tpl 优化告警格式,增加 监控对象 (#918) 2022-04-19 15:05:07 +08:00
feishu.tpl fix tple 2021-12-15 19:22:18 +08:00
mailbody.tpl 优化告警格式,增加 监控对象 (#918) 2022-04-19 15:05:07 +08:00
mm.tpl add mm notification 2022-08-31 14:11:28 +08:00
subject.tpl version 5.1 2021-11-28 18:57:49 +08:00
wecom.tpl add alert duration in wecom.tpl 2022-10-30 17:11:51 +08:00

README.md

告警消息模版文件

模版中可以使用的变量参考AlertCurEvent对象 模版语法如何使用可以参考html/template

如何在告警模版中添加监控详情url

假设web的地址是http://127.0.0.1:18000/, 实际使用时用web地址替换该地址

在监控模版中添加以下行:

  • dingtalk / wecom / feishu
[监控详情](http://127.0.0.1:18000/metric/explorer?promql={{ .PromQl | escape }})
  • mailbody
<tr>
  <th>监控详情:</th>
  <td>
    <a href="http://127.0.0.1:18000/metric/explorer?promql={{ .PromQl | escape }}" target="_blank">点击查看</a>
  </td>
</tr>