diff --git a/docs/guides/gettingStarted/admin.mdx b/docs/guides/gettingStarted/admin.mdx index 4d24d79b51..3d5f4fef64 100644 --- a/docs/guides/gettingStarted/admin.mdx +++ b/docs/guides/gettingStarted/admin.mdx @@ -101,6 +101,45 @@ docker compose 部署时,会自动部署如下组件,如使用源码部署 send_resolved: true # 告警解决时是否发送通知 ``` +5. 邮件模版文件 email.tmpl 说明:此文件是 html 格式,告警管理模块会填充里面的变量信息,然后渲染成 html 格式文件,进行邮件的发送,可根据需求自行改写: + + ```tmpl + {{ define "email.to.html" }} + {{ if eq .Status "firing" }} + {{ range .Alerts }} + +
Alert Status: firing
+Alert Program: Prometheus Alert
+Severity Level: {{ .Labels.severity }}
+Alert Type: {{ .Labels.alertname }}
+Affected Host: {{ .Labels.instance }}
+Affected Service: {{ .Labels.job }}
+Alert Subject: {{ .Annotations.summary }}
+Trigger Time: {{ .StartsAt.Format "2006-01-02 15:04:05" }}
+Alert Status: resolved
+Alert Program: Prometheus Alert
+Severity Level: {{ .Labels.severity }}
+Alert Type: {{ .Labels.alertname }}
+Affected Host: {{ .Labels.instance }}
+Affected Service: {{ .Labels.job }}
+Alert Subject: {{ .Annotations.summary }}
+Trigger Time: {{ .StartsAt.Format "2006-01-02 15:04:05" }}
+Alert Status: firing
-Alert Program: Prometheus Alert
-Severity Level: {{ .Labels.severity }}
-Alert Type: {{ .Labels.alertname }}
-Affected Host: {{ .Labels.instance }}
-Affected Service: {{ .Labels.job }}
-Alert Subject: {{ .Annotations.summary }}
-Trigger Time: {{ .StartsAt.Format "2006-01-02 15:04:05" }}
-Alert Status: resolved
-Alert Program: Prometheus Alert
-Severity Level: {{ .Labels.severity }}
-Alert Type: {{ .Labels.alertname }}
-Affected Host: {{ .Labels.instance }}
-Affected Service: {{ .Labels.job }}
-Alert Subject: {{ .Annotations.summary }}
-Trigger Time: {{ .StartsAt.Format "2006-01-02 15:04:05" }}
-