Filip Pytloun | 1ff45e8 | 2017-02-20 17:49:04 +0100 | [diff] [blame] | 1 | ======================= |
| 2 | Salt Prometheus formula |
| 3 | ======================= |
| 4 | |
| 5 | Power your metrics and alerting with a leading open-source monitoring |
| 6 | solution. |
| 7 | |
Bartosz Kupidura | 2f70396 | 2017-03-09 12:12:27 +0100 | [diff] [blame] | 8 | Sample pillars |
| 9 | ============== |
| 10 | |
| 11 | Configure prometheus server |
| 12 | --------------------------- |
| 13 | |
| 14 | .. code-block:: yaml |
| 15 | |
| 16 | prometheus: |
| 17 | server: |
Bartosz Kupidura | 8bdf3ed | 2017-12-20 11:28:41 +0100 | [diff] [blame] | 18 | version: 2.0 |
Bartosz Kupidura | 2f70396 | 2017-03-09 12:12:27 +0100 | [diff] [blame] | 19 | enabled: true |
| 20 | dir: |
Bartosz Kupidura | 597b067 | 2017-03-29 12:39:52 +0200 | [diff] [blame] | 21 | config: /srv/volumes/prometheus |
Bartosz Kupidura | 2f70396 | 2017-03-09 12:12:27 +0100 | [diff] [blame] | 22 | config_in_container: /opt/prometheus/config |
| 23 | bind: |
| 24 | port: 9090 |
| 25 | address: 0.0.0.0 |
| 26 | external_port: 15010 |
| 27 | target: |
Bartosz Kupidura | 8642002 | 2017-03-29 19:19:34 +0200 | [diff] [blame] | 28 | dns: |
Martin Polreich | e9dc060 | 2017-05-19 14:02:17 +0200 | [diff] [blame] | 29 | 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 Kupidura | 2f70396 | 2017-03-09 12:12:27 +0100 | [diff] [blame] | 41 | kubernetes: |
Martin Polreich | e9dc060 | 2017-05-19 14:02:17 +0200 | [diff] [blame] | 42 | enabled: true |
| 43 | api_ip: 127.0.0.1 |
Bartosz Kupidura | 2f70396 | 2017-03-09 12:12:27 +0100 | [diff] [blame] | 44 | ssl_dir: /opt/prometheus/config |
Bartosz Kupidura | 453e290 | 2017-03-30 15:43:41 +0200 | [diff] [blame] | 45 | cert_name: prometheus-server.crt |
| 46 | key_name: prometheus-server.key |
Bartosz Kupidura | 8642002 | 2017-03-29 19:19:34 +0200 | [diff] [blame] | 47 | etcd: |
Martin Polreich | e9dc060 | 2017-05-19 14:02:17 +0200 | [diff] [blame] | 48 | 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 Kupidura | 597b067 | 2017-03-29 12:39:52 +0200 | [diff] [blame] | 60 | recording: |
Martin Polreich | e9dc060 | 2017-05-19 14:02:17 +0200 | [diff] [blame] | 61 | instance:fd_utilization: |
Bartosz Kupidura | 597b067 | 2017-03-29 12:39:52 +0200 | [diff] [blame] | 62 | query: >- |
| 63 | process_open_fds / process_max_fds |
Bartosz Kupidura | 2f70396 | 2017-03-09 12:12:27 +0100 | [diff] [blame] | 64 | storage: |
| 65 | local: |
Bartosz Kupidura | 2f70396 | 2017-03-09 12:12:27 +0100 | [diff] [blame] | 66 | retention: "360h" |
Bartosz Kupidura | 2f70396 | 2017-03-09 12:12:27 +0100 | [diff] [blame] | 67 | 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 | |
| 77 | Configure alertmanager |
| 78 | ---------------------- |
| 79 | |
| 80 | .. code-block:: yaml |
| 81 | |
| 82 | prometheus: |
| 83 | alertmanager: |
| 84 | enabled: true |
| 85 | dir: |
Bartosz Kupidura | 597b067 | 2017-03-29 12:39:52 +0200 | [diff] [blame] | 86 | config: /srv/volumes/prometheus |
Bartosz Kupidura | 2f70396 | 2017-03-09 12:12:27 +0100 | [diff] [blame] | 87 | 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 Smola | 94baab3 | 2017-11-20 20:13:20 +0100 | [diff] [blame] | 95 | group_by: ['region', 'service'] |
Bartosz Kupidura | 2f70396 | 2017-03-09 12:12:27 +0100 | [diff] [blame] | 96 | group_wait: 60s |
| 97 | group_interval: 5m |
| 98 | repeat_interval: 3h |
Ondrej Smola | 94baab3 | 2017-11-20 20:13:20 +0100 | [diff] [blame] | 99 | receiver: default |
| 100 | inhibit_rule: |
| 101 | InhibitCriticalWhenDown: |
| 102 | enabled: true |
| 103 | source_match: |
Bartosz Kupidura | 2f70396 | 2017-03-09 12:12:27 +0100 | [diff] [blame] | 104 | severity: 'down' |
| 105 | target_match: |
| 106 | severity: 'critical' |
| 107 | equal: ['region', 'service'] |
Ondrej Smola | 94baab3 | 2017-11-20 20:13:20 +0100 | [diff] [blame] | 108 | InhibitWarningWhenDown: |
| 109 | enabled: true |
| 110 | source_match: |
Bartosz Kupidura | 2f70396 | 2017-03-09 12:12:27 +0100 | [diff] [blame] | 111 | severity: 'down' |
| 112 | target_match: |
| 113 | severity: 'warning' |
| 114 | equal: ['region', 'service'] |
Ondrej Smola | 94baab3 | 2017-11-20 20:13:20 +0100 | [diff] [blame] | 115 | InhibitWarningWhenCritical: |
| 116 | enabled: true |
| 117 | source_match: |
Bartosz Kupidura | 2f70396 | 2017-03-09 12:12:27 +0100 | [diff] [blame] | 118 | severity: 'critical' |
| 119 | target_match: |
| 120 | severity: 'warning' |
Ondrej Smola | 94baab3 | 2017-11-20 20:13:20 +0100 | [diff] [blame] | 121 | equal: ['region', 'service'] |
| 122 | receiver: |
| 123 | HTTP-notification: |
Bartosz Kupidura | 2f70396 | 2017-03-09 12:12:27 +0100 | [diff] [blame] | 124 | webhook_configs: |
Ondrej Smola | 94baab3 | 2017-11-20 20:13:20 +0100 | [diff] [blame] | 125 | localhost: |
| 126 | url: http://127.0.0.1 |
Bartosz Kupidura | 2f70396 | 2017-03-09 12:12:27 +0100 | [diff] [blame] | 127 | send_resolved: true |
Ondrej Smola | 94baab3 | 2017-11-20 20:13:20 +0100 | [diff] [blame] | 128 | HTTP-slack: |
Konstantin Hontar | 7b14dea | 2017-09-13 14:43:46 +0300 | [diff] [blame] | 129 | slack_configs: |
Ondrej Smola | 94baab3 | 2017-11-20 20:13:20 +0100 | [diff] [blame] | 130 | slack: |
| 131 | api_url: http://127.0.0.1/slack |
Konstantin Hontar | 7b14dea | 2017-09-13 14:43:46 +0300 | [diff] [blame] | 132 | send_resolved: true |
Ondrej Smola | 94baab3 | 2017-11-20 20:13:20 +0100 | [diff] [blame] | 133 | smtp: |
Konstantin Hontar | 7b14dea | 2017-09-13 14:43:46 +0300 | [diff] [blame] | 134 | email_configs: |
Ondrej Smola | 94baab3 | 2017-11-20 20:13:20 +0100 | [diff] [blame] | 135 | email: |
| 136 | to: test@example.com |
Konstantin Hontar | 7b14dea | 2017-09-13 14:43:46 +0300 | [diff] [blame] | 137 | from: test@example.com |
| 138 | smarthost: example.com |
| 139 | auth_username: username |
| 140 | auth_password: password |
| 141 | send_resolved: true |
Ondrej Smola | 94baab3 | 2017-11-20 20:13:20 +0100 | [diff] [blame] | 142 | #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 Kupidura | 2f70396 | 2017-03-09 12:12:27 +0100 | [diff] [blame] | 152 | |
| 153 | Configure pushgateway |
| 154 | --------------------- |
| 155 | |
| 156 | .. code-block:: yaml |
| 157 | |
| 158 | prometheus: |
| 159 | pushgateway: |
| 160 | enabled: true |
| 161 | external_port: 15012 |
| 162 | |
Bartosz Kupidura | 5e9fb1d | 2018-01-26 13:35:38 +0100 | [diff] [blame] | 163 | Install prometheus as service |
| 164 | ------------------------------------- |
| 165 | |
| 166 | .. code-block:: yaml |
| 167 | |
| 168 | parameters: |
| 169 | prometheus: |
| 170 | server: |
| 171 | is_container: false |