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

飞书告警详情变化 #36

Closed
wiljay opened this issue Jun 25, 2020 · 2 comments
Closed

飞书告警详情变化 #36

wiljay opened this issue Jun 25, 2020 · 2 comments

Comments

@wiljay
Copy link

wiljay commented Jun 25, 2020

PrometheusAlert故障告警信息我这里用默认接口接收prometheus的告警的话,会出现PrometheusAlert故障告警信息与PrometheusAlert故障恢复信息。但是我用自定义的模版倒没有这变化。能问下是那个变量控制的吗?
以下是我模版
{{ $var := .externalURL}}{{ range $k,$v:=.alerts }}
Prometheus告警信息
[{{$v.labels.desc}}]
告警级别:{{$v.labels.severity}}
开始时间:{{$v.startsAt}}
结束时间:{{$v.endsAt}}
故障主机IP:{{$v.labels.instance}}
故障描述: {{$v.annotations.summary}}
{{ end }}

@feiyu563
Copy link
Owner

feiyu563 commented Jun 25, 2020

参考#30

{{ $var := .externalURL}}{{ range $k,$v:=.alerts }}
{{if eq $v.status "resolved"}}

Prometheus恢复信息

{{$v.labels.alertname}}

告警级别:{{$v.labels.level}}
开始时间:{{$v.startsAt}}
结束时间:{{$v.endsAt}}
故障主机IP:{{$v.labels.instance}}
{{$v.annotations.description}}

Prometheus
{{else}}

Prometheus告警信息

{{$v.labels.alertname}}

告警级别:{{$v.labels.level}}
开始时间:{{$v.startsAt}}
结束时间:{{$v.endsAt}}
故障主机IP:{{$v.labels.instance}}
{{$v.annotations.description}}

Prometheus
{{end}}
{{ end }}

@chenHony666
Copy link

大佬们,这个externalURL怎么定义的?我的连接ip和端口不对

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

3 participants