📋
PrometheusAlert
  • README
  • 【PrometheusAlert入门】
    • 安装部署PrometheusAlert
    • 接口说明
    • Metrics指标
    • 其他配置
  • 【 app.conf 默认参数配置】
    • 钉钉告警配置
    • 飞书告警配置
    • 企业微信告警配置
    • 企业微信应用告警配置
    • 阿里云短信和电话告警配置
    • 腾讯云短信和电话告警配置
    • 容联云电话告警配置
    • 华为云短信配置
    • 百度云短信配置
    • Email配置
    • 七陌短信和电话告警配置
    • TeleGram告警配置
    • Bark告警配置
    • 百度Hi(如流)告警配置
    • 告警记录-ES接入配置
    • 语音播报
    • 飞书机器人应用
  • 【告警系统接入PrometheusAlert配置】
    • Prometheus 接入配置
    • graylog接入配置
    • grafana接入配置
    • zabbix(内置固定消息模版)接入配置
    • sonarqube接入配置
    • jenkins接入配置
    • 阿里云-云监控(自定义消息模版)接入配置
    • Gitlab webhook接入配置
    • 【WebHook】
    • ★ 进阶用法--自定义模版
    • ★ 进阶用法--自定义模版函数(时区转换、文本操作等)
    • ★ 进阶用法--自定义模版参数说明
    • ★ 进阶用法--go模版语法
  • 【Dashboard页面功能使用】
    • 【告警路由功能】
  • 【版本更新说明】
  • 【如何对PrometheusAlert进行二次开发】
  • 通用自定义模板共享链接
  • Prometheus rules共享链接
  • 【如何捐赠】
由 GitBook 提供支持
在本页

这有帮助吗?

  1. 【 app.conf 默认参数配置】

飞书机器人应用

上一页语音播报下一页【告警系统接入PrometheusAlert配置】

最后更新于2年前

这有帮助吗?


特别注意:飞书应用使用的是批量发送消息接口,消息会有一定延迟,且必须要有至少一个飞书用户open_id或user_id或union_ids或部门open_department_id,否则无法收取消息

创建飞书应用

打开飞书开放平台,创建飞书企业自建app应用 https://open.feishu.cn/app/

创建完成后,选择刚刚创建的应用,进入应用管理后台,选择 应用功能--> 机器人,开启应用的机器人能力

继续分配应用权限,选择 权限管理--> 消息与群组,开通以下权限

  • 给多个用户批量发消息

  • 给一个或多个部门的成员批量发消息

  • 获取与发送单聊、群组消息

最后发布应用版本,让具有管理员权限的用户去审核申请的权限和发布请求即可

审核完成后,获取到飞书应用的 App ID和App Secret,并配置到PrometheusAlert 的 app.conf配置项目中

飞书应用app.conf配置

#---------------------↓飞书机器人应用-----------------------
#是否开启feishuapp告警通道,可同时开始多个通道0为关闭,1为开启
open-feishuapp=1
# APPID
FEISHU_APPID=cli_xxxxxxxxxxxxxxxxxxxxx
# APPSECRET
FEISHU_APPSECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# 可填飞书 用户open_id、user_id、union_ids、部门open_department_id
AT_USER_ID="xxxxxxxxxxx"

如何查找user_id

通过飞书管理员登录飞书管理后台,进入 组织架构-->成员与部门-->找到对应的用户,查看成员详情即可

如何使用

以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=fsapp&tpl=prometheus-feishu-app&at=xxxxxxxx,xxxxxx2,xxxxxxx3'
fei
fei2
fei3
fei4
fei5
fei6
fei7