Skip to content

Commit

Permalink
feature: add alertmanager function
Browse files Browse the repository at this point in the history
  • Loading branch information
lin.huang committed Nov 15, 2023
1 parent d99454d commit 4fea9e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions config/email.tmpl
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{{ define "email.to.html" }}
{{ range .Alerts }}

---------------------------------------------------------
告警程序: prometheus_alert<br>
告警级别: {{ .Labels.severity }} 级<br>
告警类型: {{ .Labels.alertname }}<br>
故障主机: {{ .Labels.instance }}<br>
故障服务: {{ .Labels.job }}<br>
告警主题: {{ .Annotations.summary }}<br>
触发时间: {{ .StartsAt.Format "2020-01-02 15:04:05"}} <br>

----------------------------------------------------------
{{ end }}
{{ end }}
4 changes: 2 additions & 2 deletions config/instanceDown_rules.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
groups:
- name: node_down
- name: instance_down
rules:
- alert: InstanceDown
expr: up == 0
for: 1m
labels:
user: test
severity: critical
annotations:
summary: "Instance {{ $labels.instance }} down"
description: "{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 1 minutes."

0 comments on commit 4fea9e9

Please sign in to comment.