ccfos / nightingale

An all-in-one observability solution which aims to combine the advantages of Prometheus and Grafana. It manages alert rules and visualizes metrics, logs, traces in a beautiful web UI.
https://flashcat.cloud/docs/
Apache License 2.0
9.42k stars 1.38k forks source link

Feat: 回调地址 中支持 获取变量 #1998

Closed jicki closed 2 months ago

jicki commented 2 months ago

What would you like to be added:

希望在回调地址中支持 变量, 如:

回调地址: https://open.feishu.cn/open-apis/bot/v2/hook/b43e7bea-88fd-436e-3223-xdsfd233223?card=1&ats={{ $labels.id }}

Why is this needed: 可以进行一些灵活的操作. 如我在创建服务的时候就把创建者 id 或者 name 添加到 labels 中. 在触发告警的时候可以直接获取到这个 id 或者 name 进行 @ 到负责人

710leo commented 2 months ago

@jicki 欢迎贡献 pr 哈,可以参考下 rule_note 支持变量的实现