blob: de0d6fe16e910315bda56f9413f5463b18a64037 [file] [log] [blame]
Filip Pytloun1ff45e82017-02-20 17:49:04 +01001=======================
2Salt Prometheus formula
3=======================
4
5Power your metrics and alerting with a leading open-source monitoring
6solution.
7
Bartosz Kupidura2f703962017-03-09 12:12:27 +01008Sample pillars
9==============
10
11Configure prometheus server
12---------------------------
13
14.. code-block:: yaml
15
16 prometheus:
17 server:
Bartosz Kupidura8bdf3ed2017-12-20 11:28:41 +010018 version: 2.0
Bartosz Kupidura2f703962017-03-09 12:12:27 +010019 enabled: true
20 dir:
Bartosz Kupidura597b0672017-03-29 12:39:52 +020021 config: /srv/volumes/prometheus
Bartosz Kupidura2f703962017-03-09 12:12:27 +010022 config_in_container: /opt/prometheus/config
23 bind:
24 port: 9090
25 address: 0.0.0.0
26 external_port: 15010
27 target:
Bartosz Kupidura86420022017-03-29 19:19:34 +020028 dns:
Martin Polreiche9dc0602017-05-19 14:02:17 +020029 enabled: true
30 endpoint:
31 - name: 'pushgateway'
32 domain:
33 - 'tasks.prometheus_pushgateway'
34 type: A
35 port: 9091
36 - name: 'prometheus'
37 domain:
38 - 'tasks.prometheus_server'
39 type: A
40 port: 9090
Bartosz Kupidura2f703962017-03-09 12:12:27 +010041 kubernetes:
Martin Polreiche9dc0602017-05-19 14:02:17 +020042 enabled: true
43 api_ip: 127.0.0.1
Bartosz Kupidura2f703962017-03-09 12:12:27 +010044 ssl_dir: /opt/prometheus/config
Bartosz Kupidura453e2902017-03-30 15:43:41 +020045 cert_name: prometheus-server.crt
46 key_name: prometheus-server.key
Bartosz Kupidura86420022017-03-29 19:19:34 +020047 etcd:
Martin Polreiche9dc0602017-05-19 14:02:17 +020048 endpoint:
49 scheme: https
50 ssl_dir: /opt/prometheus/config
51 cert_name: prometheus-server.crt
52 key_name: prometheus-server.key
53 member:
54 - host: ${_param:cluster_node01_address}
55 port: ${_param:cluster_node01_port}
56 - host: ${_param:cluster_node02_address}
57 port: ${_param:cluster_node02_port}
58 - host: ${_param:cluster_node03_address}
59 port: ${_param:cluster_node03_port}
Bartosz Kupidura597b0672017-03-29 12:39:52 +020060 recording:
Martin Polreiche9dc0602017-05-19 14:02:17 +020061 instance:fd_utilization:
Bartosz Kupidura597b0672017-03-29 12:39:52 +020062 query: >-
63 process_open_fds / process_max_fds
Bartosz Kupidura2f703962017-03-09 12:12:27 +010064 storage:
65 local:
Bartosz Kupidura2f703962017-03-09 12:12:27 +010066 retention: "360h"
Bartosz Kupidura2f703962017-03-09 12:12:27 +010067 alertmanager:
68 notification_queue_capacity: 10000
69 config:
70 global:
71 scrape_interval: "15s"
72 scrape_timeout: "15s"
73 evaluation_interval: "1m"
74 external_labels:
75 region: 'region1'
76
77Configure alertmanager
78----------------------
79
80.. code-block:: yaml
81
82 prometheus:
83 alertmanager:
84 enabled: true
85 dir:
Bartosz Kupidura597b0672017-03-29 12:39:52 +020086 config: /srv/volumes/prometheus
Bartosz Kupidura2f703962017-03-09 12:12:27 +010087 bind:
88 address: 0.0.0.0
89 port: 9093
90 external_port: 15011
91 config:
92 global:
93 resolve_timeout: 5m
94 route:
Ondrej Smola94baab32017-11-20 20:13:20 +010095 group_by: ['region', 'service']
Bartosz Kupidura2f703962017-03-09 12:12:27 +010096 group_wait: 60s
97 group_interval: 5m
98 repeat_interval: 3h
Ondrej Smola94baab32017-11-20 20:13:20 +010099 receiver: default
100 inhibit_rule:
101 InhibitCriticalWhenDown:
102 enabled: true
103 source_match:
Bartosz Kupidura2f703962017-03-09 12:12:27 +0100104 severity: 'down'
105 target_match:
106 severity: 'critical'
107 equal: ['region', 'service']
Ondrej Smola94baab32017-11-20 20:13:20 +0100108 InhibitWarningWhenDown:
109 enabled: true
110 source_match:
Bartosz Kupidura2f703962017-03-09 12:12:27 +0100111 severity: 'down'
112 target_match:
113 severity: 'warning'
114 equal: ['region', 'service']
Ondrej Smola94baab32017-11-20 20:13:20 +0100115 InhibitWarningWhenCritical:
116 enabled: true
117 source_match:
Bartosz Kupidura2f703962017-03-09 12:12:27 +0100118 severity: 'critical'
119 target_match:
120 severity: 'warning'
Ondrej Smola94baab32017-11-20 20:13:20 +0100121 equal: ['region', 'service']
122 receiver:
123 HTTP-notification:
Bartosz Kupidura2f703962017-03-09 12:12:27 +0100124 webhook_configs:
Ondrej Smola94baab32017-11-20 20:13:20 +0100125 localhost:
126 url: http://127.0.0.1
Bartosz Kupidura2f703962017-03-09 12:12:27 +0100127 send_resolved: true
Ondrej Smola94baab32017-11-20 20:13:20 +0100128 HTTP-slack:
Konstantin Hontar7b14dea2017-09-13 14:43:46 +0300129 slack_configs:
Ondrej Smola94baab32017-11-20 20:13:20 +0100130 slack:
131 api_url: http://127.0.0.1/slack
Konstantin Hontar7b14dea2017-09-13 14:43:46 +0300132 send_resolved: true
Ondrej Smola94baab32017-11-20 20:13:20 +0100133 smtp:
Konstantin Hontar7b14dea2017-09-13 14:43:46 +0300134 email_configs:
Ondrej Smola94baab32017-11-20 20:13:20 +0100135 email:
136 to: test@example.com
Konstantin Hontar7b14dea2017-09-13 14:43:46 +0300137 from: test@example.com
138 smarthost: example.com
139 auth_username: username
140 auth_password: password
141 send_resolved: true
Ondrej Smola94baab32017-11-20 20:13:20 +0100142 #Two endpoints in one receiver
143 Multi-receiver:
144 slack_configs:
145 slack:
146 api_url: http://127.0.0.1/slack
147 send_resolved: true
148 webhook_configs:
149 webhook:
150 url: http://127.0.0.1
151 send_resolved: true
Bartosz Kupidura2f703962017-03-09 12:12:27 +0100152
153Configure pushgateway
154---------------------
155
156.. code-block:: yaml
157
158 prometheus:
159 pushgateway:
160 enabled: true
161 external_port: 15012
162
Bartosz Kupidura5e9fb1d2018-01-26 13:35:38 +0100163Install prometheus as service
164-------------------------------------
165
166.. code-block:: yaml
167
168parameters:
169 prometheus:
170 server:
171 is_container: false