forked from udacity/cdond-c3-projectstarter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalerts.yml
53 lines (47 loc) · 1.66 KB
/
alerts.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
global:
resolve_timeout: 1m
slack_api_url: https://hooks.slack.com/services/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
route:
receiver: 'default-receiver'
group_wait: 30s
group_by: [alertname]
routes:
- receiver: 'gmail-notifications'
continue: true
- receiver: 'slack-notifications'
continue: true
receivers:
- name: 'gmail-notifications'
email_configs:
- to: [email protected]
from: [email protected]
smarthost: smtp.gmail.com:587
auth_username: [email protected]
auth_identity: [email protected]
auth_password: keqlcingqjaofyut
send_resolved: true
- name: 'slack-notifications'
slack_configs:
- channel: '#random'
send_resolved: true
icon_url: https://avatars3.githubusercontent.com/u/3380462
title: |-
[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}] {{ .CommonLabels.alertname }} for {{ .CommonLabels.job }}
{{- if gt (len .CommonLabels) (len .GroupLabels) -}}
{{" "}}(
{{- with .CommonLabels.Remove .GroupLabels.Names }}
{{- range $index, $label := .SortedPairs -}}
{{ if $index }}, {{ end }}
{{- $label.Name }}="{{ $label.Value -}}"
{{- end }}
{{- end -}}
)
{{- end }}
text: >-
{{ range .Alerts -}}
*Alert:* {{ .Annotations.title }}{{ if .Labels.severity }} - `{{ .Labels.severity }}`{{ end }}
*Description:* {{ .Annotations.description }}
*Details:*
{{ range .Labels.SortedPairs }} • *{{ .Name }}:* `{{ .Value }}`
{{ end }}
{{ end }}