From 8087f705c009d30311072c203371b3cba2869c5e Mon Sep 17 00:00:00 2001 From: icey-yu <119291641+icey-yu@users.noreply.github.com> Date: Tue, 23 Jul 2024 10:26:04 +0800 Subject: [PATCH] Fix search log (#2425) * feat: update alert email template * fix: search log * fix: log support ex --- config/email.tmpl | 44 +++++++++++++++++++-------- internal/rpc/third/log.go | 5 +-- pkg/common/storage/controller/user.go | 1 + 3 files changed, 36 insertions(+), 14 deletions(-) diff --git a/config/email.tmpl b/config/email.tmpl index 0385601d0..824144e9d 100644 --- a/config/email.tmpl +++ b/config/email.tmpl @@ -1,16 +1,36 @@ {{ define "email.to.html" }} -{{ range .Alerts }} - -
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" }}
+