-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalertmanager.yml
More file actions
47 lines (44 loc) · 2 KB
/
Copy pathalertmanager.yml
File metadata and controls
47 lines (44 loc) · 2 KB
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
# https://hippogrammer.tistory.com/260
global:
resolve_timeout: 5m
# slack_api_url: 'https://hooks.slack.com/services/..'
route:
group_wait: 30s
group_interval: 5m
repeat_interval: 12h
receiver: 'slack'
# match_re:
# alertname: Elastic_UP|Elasticsearch_Too_Few_Nodes_Running|Elasticsearch_JVM_Heap_Too_High|ElasticSearchJvmMemoryPercent|ElasticNoAvailableSpace|NumberOfPendingTasks
# continue: true
receivers:
- name: 'slack'
slack_configs:
- send_resolved: true
# username: 'prometheus-alert'
channel: '#alert'
api_url: 'https://hooks.slack.com/services/XXXX'
# title: |-
# # [{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}] {{ .CommonLabels.alertname }}
# {{ template "custom_title" . }}{{- "\n" -}}{{ template "custom_slack_message" . }}
username: '{{ template "slack.default.username" . }}'
color: '{{ if eq .Status "firing" }}danger{{ else if eq .Status "pending" }}warning{{ else }}good{{ end }}'
title: '{{ template "slack.default.title" . }}'
# title_link: '{{ template "slack.default.titlelink" . }}'
pretext: '{{ .CommonAnnotations.summary }}'
text: |-
{{ range .Alerts }}
*Alert : * {{ .Annotations.title }}{{ if .Labels.severity }} - `{{ .Labels.severity }}`
*summary : * {{ .Annotations.summary }}
*Description : * {{ .Annotations.description }}
*Details : *
{{ range .Labels.SortedPairs }} • *{{ .Name }} : * `{{ .Value }}`
{{ end }}
*Grafana URL : * http://localhost:3001/{{ end }}
{{ end }}
fallback: '{{ template "slack.default.fallback" . }}'
# icon_emoji: '{{ template "slack.default.iconemoji" . }}'
# icon_url: '{{ template "slack.default.iconurl" . }}'
icon_url: http://avatars3.githubusercontent.com/u/3380462
templates:
# - '/etc/alertmanager/config/*.tmpl'
- '/slack.tmpl'