-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: update alert email template * fix: search log * fix: log support ex
- Loading branch information
Showing
3 changed files
with
36 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,36 @@ | ||
{{ define "email.to.html" }} | ||
{{ range .Alerts }} | ||
<!-- Begin of OpenIM Alert --> | ||
<div style="border:1px solid #ccc; padding:10px; margin-bottom:10px;"> | ||
<h3>OpenIM Alert</h3> | ||
<p><strong>Alert Program:</strong> Prometheus Alert</p> | ||
<p><strong>Severity Level:</strong> {{ .Labels.severity }}</p> | ||
<p><strong>Alert Type:</strong> {{ .Labels.alertname }}</p> | ||
<p><strong>Affected Host:</strong> {{ .Labels.instance }}</p> | ||
<p><strong>Affected Service:</strong> {{ .Labels.job }}</p> | ||
<p><strong>Alert Subject:</strong> {{ .Annotations.summary }}</p> | ||
<p><strong>Trigger Time:</strong> {{ .StartsAt.Format "2006-01-02 15:04:05" }}</p> | ||
</div> | ||
{{ if eq .Status "firing" }} | ||
{{ range .Alerts }} | ||
<!-- Begin of OpenIM Alert --> | ||
<div style="border:1px solid #ccc; padding:10px; margin-bottom:10px;"> | ||
<h3>OpenIM Alert</h3> | ||
<p><strong>Alert Status:</strong> firing</p> | ||
<p><strong>Alert Program:</strong> Prometheus Alert</p> | ||
<p><strong>Severity Level:</strong> {{ .Labels.severity }}</p> | ||
<p><strong>Alert Type:</strong> {{ .Labels.alertname }}</p> | ||
<p><strong>Affected Host:</strong> {{ .Labels.instance }}</p> | ||
<p><strong>Affected Service:</strong> {{ .Labels.job }}</p> | ||
<p><strong>Alert Subject:</strong> {{ .Annotations.summary }}</p> | ||
<p><strong>Trigger Time:</strong> {{ .StartsAt.Format "2006-01-02 15:04:05" }}</p> | ||
</div> | ||
{{ end }} | ||
|
||
|
||
{{ else if eq .Status "resolved" }} | ||
{{ range .Alerts }} | ||
<!-- Begin of OpenIM Alert --> | ||
<div style="border:1px solid #ccc; padding:10px; margin-bottom:10px;"> | ||
<h3>OpenIM Alert</h3> | ||
<p><strong>Alert Status:</strong> resolved</p> | ||
<p><strong>Alert Program:</strong> Prometheus Alert</p> | ||
<p><strong>Severity Level:</strong> {{ .Labels.severity }}</p> | ||
<p><strong>Alert Type:</strong> {{ .Labels.alertname }}</p> | ||
<p><strong>Affected Host:</strong> {{ .Labels.instance }}</p> | ||
<p><strong>Affected Service:</strong> {{ .Labels.job }}</p> | ||
<p><strong>Alert Subject:</strong> {{ .Annotations.summary }}</p> | ||
<p><strong>Trigger Time:</strong> {{ .StartsAt.Format "2006-01-02 15:04:05" }}</p> | ||
</div> | ||
{{ end }} | ||
<!-- End of OpenIM Alert --> | ||
{{ end }} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters