Browse Source

yaml config can only be read consistently from pillar. Changed in

prometheus and alertmanager
pull/2/head
Ricardo Hernandez 5 years ago
parent
commit
4b1522ca38
  1. 14
      pillar.example
  2. 7
      prometheus/alertmanager.sls
  3. 41
      prometheus/defaults.yaml
  4. 2
      prometheus/server.sls

14
pillar.example

@ -1,9 +1,9 @@
prometheus:
server:
version: 1.1.3.linux-amd64
version: 1.3.1.linux-amd64
install_dir: /opt
source: https://github.com/prometheus/prometheus/releases/download/v1.1.3/prometheus-1.1.3.linux-amd64.tar.gz
source_hash: md5=839293afa9bfce47c476a0bdfd01a780
source: 'https://github.com/prometheus/prometheus/releases/download/v1.3.1/prometheus-1.3.1.linux-amd64.tar.gz'
source_hash: sha1=a5e476604086533951a81f5653ccc49141b057c5
args:
config_file: /etc/prometheus/prometheus.yml
storage:
@ -22,10 +22,10 @@ prometheus:
static_configs:
- targets: ['localhost:9100']
alertmanager:
version: 0.4.2.linux-amd64
version: 0.5.0.linux-amd64
install_dir: /opt
source: https://github.com/prometheus/alertmanager/releases/download/v0.4.2/alertmanager-0.4.2.linux-amd64.tar.gz
source_hash: md5=715878f14ab091769c989ecdb2db9f15
source: https://github.com/prometheus/alertmanager/releases/download/v0.5.0/alertmanager-0.5.0.linux-amd64.tar.gz
source_hash: sha1=2669d6b0143896b634699e7d70f95f5da92ad94f
args:
config_file: /etc/alertmanager/alertmanager.yml
storage:
@ -63,4 +63,4 @@ prometheus:
version: 0.12.0.linux-amd64
install_dir: /opt
source: https://github.com/prometheus/node_exporter/releases/download/0.12.0/node_exporter-0.12.0.linux-amd64.tar.gz
source_hash: md5=efe49b6fae4b1a5cb75b24a60a35e1fc
source_hash: md5=efe49b6fae4b1a5cb75b24a60a35e1fc

7
prometheus/alertmanager.sls

@ -19,6 +19,13 @@ alertmanager_bin_link:
- require:
- archive: alertmanager_tarball
alertmanager_config:
file.serialize:
- name: {{ prometheus.alertmanager.args.config_file }}
- user: prometheus
- group: prometheus
- dataset_pillar: prometheus:alertmanager:config
alertmanager_config:
file.managed:
- name: {{ prometheus.alertmanager.args.config_file }}

41
prometheus/defaults.yaml

@ -8,19 +8,6 @@ prometheus:
config_file: /etc/prometheus/prometheus.yml
storage:
local_path: /var/lib/prometheus/metrics
config:
global:
scrape_interval: 15s
evaluation_interval: 15s
scrape_configs:
- job_name: 'prometheus'
scrape_interval: 5s
static_configs:
- targets: ['localhost:9090']
- job_name: 'node'
scrape_interval: 5s
static_configs:
- targets: ['localhost:9100']
alertmanager:
version: 0.5.0.linux-amd64
install_dir: /opt
@ -30,34 +17,6 @@ prometheus:
config_file: /etc/alertmanager/alertmanager.yml
storage:
path: /var/lib/alertmanager
config:
global:
smtp_smarthost: "localhost:25"
smtp_from: 'alertmanager@example.org'
smtp_auth_username: 'alertmanager'
smtp_auth_password: 'password'
templates:
- "/etc/alertmanager/template/*.tmpl"
route:
group_by: ['alertname', 'cluster', 'service']
group_wait: 30s
group_interval: 5m
repeat_interval: 3h
receiver: team-X-mails
routes:
- match_re:
service: ^(foo1|foo2|baz)$
receiver: team-X-mails
inhibit_rules:
- source_match:
severity: 'critical'
target_match:
severity: 'warning'
equal: ['alertname', 'cluster', 'service']
receivers:
- name: 'team-X-mails'
email_configs:
- to: 'team-X+alerts@example.org'
exporters:
node:
version: 0.12.0.linux-amd64

2
prometheus/server.sls

@ -24,7 +24,7 @@ prometheus_server_config:
- name: {{ prometheus.server.args.config_file }}
- user: prometheus
- group: prometheus
- dataset: {{prometheus.server.config}}
- dataset_pillar: prometheus:server:config
prometheus_defaults:
file.managed:

Loading…
Cancel
Save