We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
{{ $var := .externalURL}}{{ range $k,$v:=.alerts }}{{if eq $v.status "resolved"}}Prometheus恢复信息 {{$v.labels.alertname}} 告警级别:{{$v.labels.severity}} 开始时间:{{$v.startsAt}} 结束时间:{{$v.endsAt}} 故障主机IP:{{$v.labels.instance}} {{$v.annotations.description}}{{else}}Prometheus告警信息 {{$v.labels.alertname}} 告警级别:{{$v.labels.severity}} 开始时间:{{$v.startsAt}} 故障主机IP:{{$v.labels.instance}} {{$v.annotations.description}}{{end}}{{ end }} {{ $urimsg:=""}}{{ range $key,$value:=.commonLabels }}{{$urimsg = print $urimsg $key "%3D%22" $value "%22%2C" }}{{end}}[*** 点我屏蔽该告警]({{$var}}/#/silences/new?filter=%7B{{SplitString $urimsg 0 -3}}%7D)
默认模板 {{if eq $v.status "resolved"}} 当我传入状态为resloved的内容是,飞书通知还是红色的。 看了源码没啥问题
The text was updated successfully, but these errors were encountered:
需要在模板里加个告警状态就好了,如下:
Sorry, something went wrong.
太溜了
解决了,感觉
No branches or pull requests
{{ $var := .externalURL}}{{ range $k,$v:=.alerts }}{{if eq $v.status "resolved"}}Prometheus恢复信息
{{$v.labels.alertname}}
告警级别:{{$v.labels.severity}}
开始时间:{{$v.startsAt}}
结束时间:{{$v.endsAt}}
故障主机IP:{{$v.labels.instance}}
{{$v.annotations.description}}{{else}}Prometheus告警信息
{{$v.labels.alertname}}
告警级别:{{$v.labels.severity}}
开始时间:{{$v.startsAt}}
故障主机IP:{{$v.labels.instance}}
{{$v.annotations.description}}{{end}}{{ end }}
{{ $urimsg:=""}}{{ range $key,$value:=.commonLabels }}{{$urimsg = print $urimsg $key "%3D%22" $value "%22%2C" }}{{end}}[*** 点我屏蔽该告警]({{$var}}/#/silences/new?filter=%7B{{SplitString $urimsg 0 -3}}%7D)
默认模板 {{if eq $v.status "resolved"}} 当我传入状态为resloved的内容是,飞书通知还是红色的。 看了源码没啥问题
The text was updated successfully, but these errors were encountered: