飞书告警配置


飞书机器人目前支持V1和V2两个版本,区别在于地址的不同

V1地址:https://open.feishu.cn/open-apis/bot/hook​/​xxxxxxxxxxxxxxxxxx V2地址:https://open.feishu.cn/open-apis/bot/v2/hook/xxxxxxxxxxxxxxxxx

开启飞书机器人v1

打开飞书,进入飞书群中,选择群设置-->群机器人-->添加机器人-->Custom Bot,可参下图:

复制图中的Webhook地址,并填入PrometheusAlert配置文件app.conf中对应配置项即可。

开启飞书机器人v2

PS: 飞书机器人V2目前已经支持 @某人 ,使用该功能需要取得对应用户的飞书关联的Email邮箱地址。

飞书相关配置:

#---------------------↓webhook-----------------------
#是否开启飞书告警通道,可同时开始多个通道0为关闭,1为开启
open-feishu=1
#默认飞书机器人地址
fsurl=https://open.feishu.cn/open-apis/bot/v2/hook/xxxxxxxxxxxxxxxxx

如何使用

以Prometheus配合自定义模板为例:

Prometheus配置参考:

global:
  resolve_timeout: 5m
route:
  group_by: ['instance']
  group_wait: 10m
  group_interval: 10s
  repeat_interval: 10m
  receiver: 'web.hook.prometheusalert'
receivers:
- name: 'web.hook.prometheusalert'
  webhook_configs:
  - url: 'http://[prometheusalert_url]:8080/prometheusalert?type=fs&tpl=prometheus-fs&fsurl=飞书机器人地址,飞书机器人地址2'

最后更新于