Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

是否可以按照调用url所传入的值决定告警方式,而不是根据告警级别来固定告警方式? #43

Closed
minibear2333 opened this issue Jul 31, 2020 · 1 comment

Comments

@minibear2333
Copy link
Contributor

minibear2333 commented Jul 31, 2020

假设只有邮件短信两种告警方式,想要自己决定,所有告警级别全部发邮件,或者1,2发邮件,3,4,5发短信。
如果可以通过Url传入参数来决定,会更加灵活。
我看到如下位置的代码,部分是支持的根据url来解析告警通知方式的

if RMessage.Annotations.Ddurl==""{

建议短信和电话也切换成这种方式,如果您认同我的看法请告知我,我将会协助您一起修改

@feiyu563
Copy link
Owner

feiyu563 commented Aug 3, 2020

自定义模板的接口可以支持通过URL作为参数指定告警通知的方式。结合alertmanger的路由可以做到更精确的告警路由,老的/prometheus/alert/prometheus/router 接口主要是早期为了方便部分用户而设计的,后面还是比较推荐使用自定义模板接口,相对老的接口会更加灵活一些。

@feiyu563 feiyu563 closed this as completed Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants