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: |
| 18 | enabled: true |
| 19 | dir: |
Bartosz Kupidura | 597b067 | 2017-03-29 12:39:52 +0200 | [diff] [blame] | 20 | config: /srv/volumes/prometheus |
Bartosz Kupidura | 2f70396 | 2017-03-09 12:12:27 +0100 | [diff] [blame] | 21 | config_in_container: /opt/prometheus/config |
| 22 | bind: |
| 23 | port: 9090 |
| 24 | address: 0.0.0.0 |
| 25 | external_port: 15010 |
| 26 | target: |
Bartosz Kupidura | 8642002 | 2017-03-29 19:19:34 +0200 | [diff] [blame] | 27 | dns: |
| 28 | - name: 'pushgateway' |
| 29 | domain: |
| 30 | - 'tasks.prometheus_pushgateway' |
| 31 | type: A |
| 32 | port: 9091 |
| 33 | - name: 'prometheus' |
| 34 | domain: |
| 35 | - 'tasks.prometheus_server' |
| 36 | type: A |
| 37 | port: 9090 |
Bartosz Kupidura | 2f70396 | 2017-03-09 12:12:27 +0100 | [diff] [blame] | 38 | kubernetes: |
Bartosz Kupidura | 8642002 | 2017-03-29 19:19:34 +0200 | [diff] [blame] | 39 | api_ip: ${_param:kubernetes_control_address} |
Bartosz Kupidura | 2f70396 | 2017-03-09 12:12:27 +0100 | [diff] [blame] | 40 | ssl_dir: /opt/prometheus/config |
Bartosz Kupidura | 453e290 | 2017-03-30 15:43:41 +0200 | [diff] [blame^] | 41 | cert_name: prometheus-server.crt |
| 42 | key_name: prometheus-server.key |
Bartosz Kupidura | 8642002 | 2017-03-29 19:19:34 +0200 | [diff] [blame] | 43 | etcd: |
Bartosz Kupidura | 453e290 | 2017-03-30 15:43:41 +0200 | [diff] [blame^] | 44 | scheme: https |
| 45 | ssl_dir: /opt/prometheus/config |
| 46 | cert_name: prometheus-server.crt |
| 47 | key_name: prometheus-server.key |
| 48 | member: |
| 49 | - host: ${_param:cluster_node01_address} |
| 50 | port: ${_param:cluster_node01_port} |
| 51 | - host: ${_param:cluster_node02_address} |
| 52 | port: ${_param:cluster_node02_port} |
| 53 | - host: ${_param:cluster_node03_address} |
| 54 | port: ${_param:cluster_node03_port} |
Bartosz Kupidura | 597b067 | 2017-03-29 12:39:52 +0200 | [diff] [blame] | 55 | recording: |
| 56 | - name: 'instance:fd_utilization' |
| 57 | query: >- |
| 58 | process_open_fds / process_max_fds |
Bartosz Kupidura | 2f70396 | 2017-03-09 12:12:27 +0100 | [diff] [blame] | 59 | alert: |
| 60 | PrometheusTargetDown: |
| 61 | if: 'up != 1' |
| 62 | labels: |
| 63 | severity: down |
| 64 | annotations: |
| 65 | summary: 'Prometheus target down' |
| 66 | storage: |
| 67 | local: |
| 68 | engine: "persisted" |
| 69 | retention: "360h" |
| 70 | memory_chunks: 1048576 |
| 71 | max_chunks_to_persist: 524288 |
| 72 | num_fingerprint_mutexes: 4096 |
| 73 | alertmanager: |
| 74 | notification_queue_capacity: 10000 |
| 75 | config: |
| 76 | global: |
| 77 | scrape_interval: "15s" |
| 78 | scrape_timeout: "15s" |
| 79 | evaluation_interval: "1m" |
| 80 | external_labels: |
| 81 | region: 'region1' |
| 82 | |
| 83 | Configure alertmanager |
| 84 | ---------------------- |
| 85 | |
| 86 | .. code-block:: yaml |
| 87 | |
| 88 | prometheus: |
| 89 | alertmanager: |
| 90 | enabled: true |
| 91 | dir: |
Bartosz Kupidura | 597b067 | 2017-03-29 12:39:52 +0200 | [diff] [blame] | 92 | config: /srv/volumes/prometheus |
Bartosz Kupidura | 2f70396 | 2017-03-09 12:12:27 +0100 | [diff] [blame] | 93 | bind: |
| 94 | address: 0.0.0.0 |
| 95 | port: 9093 |
| 96 | external_port: 15011 |
| 97 | config: |
| 98 | global: |
| 99 | resolve_timeout: 5m |
| 100 | route: |
| 101 | group_by: ['alertname', 'region', 'service'] |
| 102 | group_wait: 60s |
| 103 | group_interval: 5m |
| 104 | repeat_interval: 3h |
| 105 | receiver: HTTP-notification |
| 106 | inhibit_rules: |
| 107 | - source_match: |
| 108 | severity: 'down' |
| 109 | target_match: |
| 110 | severity: 'critical' |
| 111 | equal: ['region', 'service'] |
| 112 | - source_match: |
| 113 | severity: 'down' |
| 114 | target_match: |
| 115 | severity: 'warning' |
| 116 | equal: ['region', 'service'] |
| 117 | - source_match: |
| 118 | severity: 'critical' |
| 119 | target_match: |
| 120 | severity: 'warning' |
| 121 | equal: ['alertname', 'region', 'service'] |
| 122 | receivers: |
| 123 | - name: 'HTTP-notification' |
| 124 | webhook_configs: |
| 125 | - url: http://127.0.0.1 |
| 126 | send_resolved: true |
| 127 | |
| 128 | Configure pushgateway |
| 129 | --------------------- |
| 130 | |
| 131 | .. code-block:: yaml |
| 132 | |
| 133 | prometheus: |
| 134 | pushgateway: |
| 135 | enabled: true |
| 136 | external_port: 15012 |
| 137 | |
Filip Pytloun | 1ff45e8 | 2017-02-20 17:49:04 +0100 | [diff] [blame] | 138 | Documentation and Bugs |
| 139 | ====================== |
| 140 | |
| 141 | To learn how to install and update salt-formulas, consult the documentation |
| 142 | available online at: |
| 143 | |
| 144 | http://salt-formulas.readthedocs.io/ |
| 145 | |
| 146 | In the unfortunate event that bugs are discovered, they should be reported to |
| 147 | the appropriate issue tracker. Use Github issue tracker for specific salt |
| 148 | formula: |
| 149 | |
| 150 | https://github.com/salt-formulas/salt-formula-logrotate/issues |
| 151 | |
| 152 | For feature requests, bug reports or blueprints affecting entire ecosystem, |
| 153 | use Launchpad salt-formulas project: |
| 154 | |
| 155 | https://launchpad.net/salt-formulas |
| 156 | |
| 157 | You can also join salt-formulas-users team and subscribe to mailing list: |
| 158 | |
| 159 | https://launchpad.net/~salt-formulas-users |
| 160 | |
| 161 | Developers wishing to work on the salt-formulas projects should always base |
| 162 | their work on master branch and submit pull request against specific formula. |
| 163 | |
| 164 | https://github.com/salt-formulas/salt-formula-logrotate |
| 165 | |
| 166 | Any questions or feedback is always welcome so feel free to join our IRC |
| 167 | channel: |
| 168 | |
| 169 | #salt-formulas @ irc.freenode.net |