2017-02-20 11:49:04 -05:00
|
|
|
=======================
|
|
|
|
Salt Prometheus formula
|
|
|
|
=======================
|
|
|
|
|
|
|
|
Power your metrics and alerting with a leading open-source monitoring
|
|
|
|
solution.
|
|
|
|
|
2017-03-09 06:12:27 -05:00
|
|
|
Sample pillars
|
|
|
|
==============
|
|
|
|
|
|
|
|
Configure prometheus server
|
|
|
|
---------------------------
|
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
prometheus:
|
|
|
|
server:
|
2017-12-20 05:28:41 -05:00
|
|
|
version: 2.0
|
2017-03-09 06:12:27 -05:00
|
|
|
enabled: true
|
|
|
|
dir:
|
2017-03-29 06:39:52 -04:00
|
|
|
config: /srv/volumes/prometheus
|
2017-03-09 06:12:27 -05:00
|
|
|
config_in_container: /opt/prometheus/config
|
|
|
|
bind:
|
|
|
|
port: 9090
|
|
|
|
address: 0.0.0.0
|
|
|
|
external_port: 15010
|
|
|
|
target:
|
2017-03-29 13:19:34 -04:00
|
|
|
dns:
|
2017-05-19 08:02:17 -04:00
|
|
|
enabled: true
|
|
|
|
endpoint:
|
|
|
|
- name: 'pushgateway'
|
|
|
|
domain:
|
|
|
|
- 'tasks.prometheus_pushgateway'
|
|
|
|
type: A
|
|
|
|
port: 9091
|
|
|
|
- name: 'prometheus'
|
|
|
|
domain:
|
|
|
|
- 'tasks.prometheus_server'
|
|
|
|
type: A
|
|
|
|
port: 9090
|
2017-03-09 06:12:27 -05:00
|
|
|
kubernetes:
|
2017-05-19 08:02:17 -04:00
|
|
|
enabled: true
|
|
|
|
api_ip: 127.0.0.1
|
2017-03-09 06:12:27 -05:00
|
|
|
ssl_dir: /opt/prometheus/config
|
2017-03-30 09:43:41 -04:00
|
|
|
cert_name: prometheus-server.crt
|
|
|
|
key_name: prometheus-server.key
|
2017-03-29 13:19:34 -04:00
|
|
|
etcd:
|
2017-05-19 08:02:17 -04:00
|
|
|
endpoint:
|
|
|
|
scheme: https
|
|
|
|
ssl_dir: /opt/prometheus/config
|
|
|
|
cert_name: prometheus-server.crt
|
|
|
|
key_name: prometheus-server.key
|
|
|
|
member:
|
|
|
|
- host: ${_param:cluster_node01_address}
|
|
|
|
port: ${_param:cluster_node01_port}
|
|
|
|
- host: ${_param:cluster_node02_address}
|
|
|
|
port: ${_param:cluster_node02_port}
|
|
|
|
- host: ${_param:cluster_node03_address}
|
|
|
|
port: ${_param:cluster_node03_port}
|
2017-03-29 06:39:52 -04:00
|
|
|
recording:
|
2017-05-19 08:02:17 -04:00
|
|
|
instance:fd_utilization:
|
2017-03-29 06:39:52 -04:00
|
|
|
query: >-
|
|
|
|
process_open_fds / process_max_fds
|
2017-03-09 06:12:27 -05:00
|
|
|
storage:
|
|
|
|
local:
|
|
|
|
retention: "360h"
|
|
|
|
alertmanager:
|
|
|
|
notification_queue_capacity: 10000
|
|
|
|
config:
|
|
|
|
global:
|
|
|
|
scrape_interval: "15s"
|
|
|
|
scrape_timeout: "15s"
|
|
|
|
evaluation_interval: "1m"
|
|
|
|
external_labels:
|
|
|
|
region: 'region1'
|
|
|
|
|
|
|
|
Configure alertmanager
|
|
|
|
----------------------
|
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
prometheus:
|
|
|
|
alertmanager:
|
|
|
|
enabled: true
|
|
|
|
dir:
|
2017-03-29 06:39:52 -04:00
|
|
|
config: /srv/volumes/prometheus
|
2017-03-09 06:12:27 -05:00
|
|
|
bind:
|
|
|
|
address: 0.0.0.0
|
|
|
|
port: 9093
|
|
|
|
external_port: 15011
|
|
|
|
config:
|
|
|
|
global:
|
|
|
|
resolve_timeout: 5m
|
|
|
|
route:
|
2017-11-20 14:13:20 -05:00
|
|
|
group_by: ['region', 'service']
|
2017-03-09 06:12:27 -05:00
|
|
|
group_wait: 60s
|
|
|
|
group_interval: 5m
|
|
|
|
repeat_interval: 3h
|
2017-11-20 14:13:20 -05:00
|
|
|
receiver: default
|
|
|
|
inhibit_rule:
|
|
|
|
InhibitCriticalWhenDown:
|
|
|
|
enabled: true
|
|
|
|
source_match:
|
2017-03-09 06:12:27 -05:00
|
|
|
severity: 'down'
|
|
|
|
target_match:
|
|
|
|
severity: 'critical'
|
|
|
|
equal: ['region', 'service']
|
2017-11-20 14:13:20 -05:00
|
|
|
InhibitWarningWhenDown:
|
|
|
|
enabled: true
|
|
|
|
source_match:
|
2017-03-09 06:12:27 -05:00
|
|
|
severity: 'down'
|
|
|
|
target_match:
|
|
|
|
severity: 'warning'
|
|
|
|
equal: ['region', 'service']
|
2017-11-20 14:13:20 -05:00
|
|
|
InhibitWarningWhenCritical:
|
|
|
|
enabled: true
|
|
|
|
source_match:
|
2017-03-09 06:12:27 -05:00
|
|
|
severity: 'critical'
|
|
|
|
target_match:
|
|
|
|
severity: 'warning'
|
2017-11-20 14:13:20 -05:00
|
|
|
equal: ['region', 'service']
|
|
|
|
receiver:
|
|
|
|
HTTP-notification:
|
2017-03-09 06:12:27 -05:00
|
|
|
webhook_configs:
|
2017-11-20 14:13:20 -05:00
|
|
|
localhost:
|
|
|
|
url: http://127.0.0.1
|
2017-03-09 06:12:27 -05:00
|
|
|
send_resolved: true
|
2017-11-20 14:13:20 -05:00
|
|
|
HTTP-slack:
|
2017-09-13 07:43:46 -04:00
|
|
|
slack_configs:
|
2017-11-20 14:13:20 -05:00
|
|
|
slack:
|
|
|
|
api_url: http://127.0.0.1/slack
|
2017-09-13 07:43:46 -04:00
|
|
|
send_resolved: true
|
2017-11-20 14:13:20 -05:00
|
|
|
smtp:
|
2017-09-13 07:43:46 -04:00
|
|
|
email_configs:
|
2017-11-20 14:13:20 -05:00
|
|
|
email:
|
|
|
|
to: test@example.com
|
2017-09-13 07:43:46 -04:00
|
|
|
from: test@example.com
|
|
|
|
smarthost: example.com
|
|
|
|
auth_username: username
|
|
|
|
auth_password: password
|
|
|
|
send_resolved: true
|
2017-11-20 14:13:20 -05:00
|
|
|
#Two endpoints in one receiver
|
|
|
|
Multi-receiver:
|
|
|
|
slack_configs:
|
|
|
|
slack:
|
|
|
|
api_url: http://127.0.0.1/slack
|
|
|
|
send_resolved: true
|
|
|
|
webhook_configs:
|
|
|
|
webhook:
|
|
|
|
url: http://127.0.0.1
|
|
|
|
send_resolved: true
|
2017-03-09 06:12:27 -05:00
|
|
|
|
|
|
|
Configure pushgateway
|
|
|
|
---------------------
|
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
prometheus:
|
|
|
|
pushgateway:
|
|
|
|
enabled: true
|
|
|
|
external_port: 15012
|
|
|
|
|
2018-01-26 07:35:38 -05:00
|
|
|
Install prometheus as service
|
|
|
|
-------------------------------------
|
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
parameters:
|
|
|
|
prometheus:
|
|
|
|
server:
|
|
|
|
is_container: false
|
|
|
|
|
|
|
|
|
2017-02-20 11:49:04 -05:00
|
|
|
Documentation and Bugs
|
|
|
|
======================
|
|
|
|
|
|
|
|
To learn how to install and update salt-formulas, consult the documentation
|
|
|
|
available online at:
|
|
|
|
|
|
|
|
http://salt-formulas.readthedocs.io/
|
|
|
|
|
|
|
|
In the unfortunate event that bugs are discovered, they should be reported to
|
|
|
|
the appropriate issue tracker. Use Github issue tracker for specific salt
|
|
|
|
formula:
|
|
|
|
|
|
|
|
https://github.com/salt-formulas/salt-formula-logrotate/issues
|
|
|
|
|
|
|
|
For feature requests, bug reports or blueprints affecting entire ecosystem,
|
|
|
|
use Launchpad salt-formulas project:
|
|
|
|
|
|
|
|
https://launchpad.net/salt-formulas
|
|
|
|
|
|
|
|
You can also join salt-formulas-users team and subscribe to mailing list:
|
|
|
|
|
|
|
|
https://launchpad.net/~salt-formulas-users
|
|
|
|
|
|
|
|
Developers wishing to work on the salt-formulas projects should always base
|
|
|
|
their work on master branch and submit pull request against specific formula.
|
|
|
|
|
|
|
|
https://github.com/salt-formulas/salt-formula-logrotate
|
|
|
|
|
|
|
|
Any questions or feedback is always welcome so feel free to join our IRC
|
|
|
|
channel:
|
|
|
|
|
|
|
|
#salt-formulas @ irc.freenode.net
|