所以我们的警报看起来像
ALERT alert_name
condition
FOR 30s
LABELS {some labels}
ANNOTATIONS {
header = "<b> data is {{ $labels.label_name }} </b>"
}
电子邮件模板看起来像。
{{ define "our_default_template" }}
{{range .Alerts}}
{{ .Annotations.header }}
{{ end }}
{{ end }}
alertmanager.yml 看起来像
receivers:
- name: 'email-sender'
email_configs:
- to: "email address"
send_resolved: true
html: '{{ template "our_default_template" . }}'
templates:
- '<path to templates>/*tmpl'
我们收到电子邮件,但内容不正确。
我们收到的邮件:
<b> data is label_value </b>
我们想要什么:
数据是标签值
所以我们想要的是html输出。
有人可以帮忙吗?