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