2019-04-24 18:18:44 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: ft=yaml
|
|
|
|
---
|
|
|
|
prometheus:
|
2019-06-20 02:36:58 +02:00
|
|
|
wanted:
|
|
|
|
- prometheus
|
2019-06-23 16:24:54 +02:00
|
|
|
{%- if grains.os_family not in ('Debian',) %}
|
|
|
|
- alertmanager
|
|
|
|
{%- endif %}
|
2019-10-03 22:15:38 +02:00
|
|
|
- node_exporter
|
2019-06-22 19:24:19 +02:00
|
|
|
# no memcached_exporter in upstream repo - only archive
|
|
|
|
# memcached_exporter
|
2019-06-20 02:36:58 +02:00
|
|
|
|
2019-06-23 16:24:54 +02:00
|
|
|
use_upstream_archive: False
|
2019-06-22 23:34:37 +02:00
|
|
|
{%- if grains.os_family in ('CentOS',) %}
|
|
|
|
use_upstream_repo: False
|
|
|
|
{%- endif %}
|
2019-06-22 19:19:41 +02:00
|
|
|
|
2019-06-08 19:39:21 +02:00
|
|
|
pkg:
|
2019-06-20 02:36:58 +02:00
|
|
|
prometheus:
|
2019-06-22 23:34:37 +02:00
|
|
|
archive_version: '2.10.0'
|
2019-06-20 02:36:58 +02:00
|
|
|
archive_hash: f4233783826f18606b79e5cef0686e4a9c2030146a3c7ce134f0add09f5adcb7
|
|
|
|
alertmanager:
|
|
|
|
archive_version: '0.17.0'
|
|
|
|
archive_hash: ec171b13976baceace193461f8a1e61021ab9657df5ba45157cd0095aee7d569
|
2019-04-24 18:18:44 +02:00
|
|
|
|
2019-06-20 02:36:58 +02:00
|
|
|
service:
|
2019-06-22 23:34:37 +02:00
|
|
|
prometheus:
|
2019-06-20 02:36:58 +02:00
|
|
|
args:
|
|
|
|
web.listen-address: 0.0.0.0:9090
|
2019-08-06 21:57:50 +02:00
|
|
|
# pushgateway:
|
|
|
|
# args:
|
|
|
|
# web.listen-address: ":9091"
|
|
|
|
# web.telemetry-path: "/metrics"
|
2019-06-20 02:36:58 +02:00
|
|
|
node_exporter:
|
|
|
|
args:
|
|
|
|
web.listen-address: ":9110"
|
2019-10-04 01:16:27 +02:00
|
|
|
# collector.textfile.directory: /var/tmp/node_exporter
|
2019-06-16 02:33:24 +02:00
|
|
|
|
2019-04-24 18:18:44 +02:00
|
|
|
tofs:
|
|
|
|
# The files_switch key serves as a selector for alternative
|
|
|
|
# directories under the formula files directory. See TOFS pattern
|
|
|
|
# doc for more info.
|
|
|
|
# Note: Any value not evaluated by `config.get` will be used literally.
|
|
|
|
# This can be used to set custom paths, as many levels deep as required.
|
|
|
|
files_switch:
|
|
|
|
- any/path/can/be/used/here
|
|
|
|
- id
|
|
|
|
- osfinger
|
|
|
|
- os
|
|
|
|
- os_family
|
|
|
|
# All aspects of path/file resolution are customisable using the options below.
|
|
|
|
# This is unnecessary in most cases; there are sensible defaults.
|
|
|
|
# path_prefix: prometheus_alt
|
|
|
|
# dirs:
|
|
|
|
# files: files_alt
|
|
|
|
# default: default_alt
|
2019-08-06 21:57:50 +02:00
|
|
|
source_files:
|
|
|
|
prometheus-config-file-file-managed:
|
|
|
|
- 'alt_config.yml.jinja'
|
2019-04-24 18:18:44 +02:00
|
|
|
|
|
|
|
# Pillar-based config
|
|
|
|
config:
|
2019-06-20 02:36:58 +02:00
|
|
|
prometheus:
|
2019-08-06 21:57:50 +02:00
|
|
|
# yamllint disable-line rule:line-length
|
2019-06-20 02:36:58 +02:00
|
|
|
# ref https://raw.githubusercontent.com/prometheus/prometheus/release-2.10/config/testdata/conf.good.yml
|
|
|
|
# my global config
|
|
|
|
global:
|
2019-08-06 21:57:50 +02:00
|
|
|
# Set the scrape interval to every 15 seconds. Default is every 1 minute.
|
|
|
|
scrape_interval: 15s
|
|
|
|
# Evaluate rules every 15 seconds. The default is every 1 minute.
|
|
|
|
evaluation_interval: 15s
|
2019-06-20 02:36:58 +02:00
|
|
|
# scrape_timeout is set to the global default (10s).
|
2019-04-24 18:18:44 +02:00
|
|
|
|
2019-06-20 02:36:58 +02:00
|
|
|
# Alertmanager configuration
|
|
|
|
alerting:
|
|
|
|
alertmanagers:
|
2019-08-06 21:57:50 +02:00
|
|
|
- static_configs:
|
|
|
|
- targets:
|
2019-09-10 06:57:10 +02:00
|
|
|
- alertmanager1:9093
|
|
|
|
- alertmanager2:9093
|
|
|
|
- alertmanager3:9093
|
2019-04-24 18:18:44 +02:00
|
|
|
|
2019-08-06 21:57:50 +02:00
|
|
|
# Load rules once and periodically evaluate them according to the global
|
|
|
|
# 'evaluation_interval'.
|
2019-06-20 02:36:58 +02:00
|
|
|
rule_files:
|
2019-08-06 21:57:50 +02:00
|
|
|
- "first_rules.yml"
|
2019-06-20 02:36:58 +02:00
|
|
|
# - "second_rules.yml"
|
2019-04-24 18:18:44 +02:00
|
|
|
|
2019-06-20 02:36:58 +02:00
|
|
|
# A scrape configuration containing exactly one endpoint to scrape:
|
|
|
|
scrape_configs:
|
2019-08-06 21:57:50 +02:00
|
|
|
# The job name is added as a label `job=<job_name>` to any timeseries
|
|
|
|
# scraped from this config.
|
2019-06-20 02:36:58 +02:00
|
|
|
- job_name: 'prometheus'
|
|
|
|
# metrics_path defaults to '/metrics'
|
|
|
|
# scheme defaults to 'http'.
|
|
|
|
static_configs:
|
2019-08-06 21:57:50 +02:00
|
|
|
- targets: ['localhost:9090']
|
2019-04-24 18:18:44 +02:00
|
|
|
|
2019-06-20 02:36:58 +02:00
|
|
|
- job_name: pushgateway
|
|
|
|
scrape_interval: 5s
|
|
|
|
honor_labels: true
|
|
|
|
static_configs:
|
|
|
|
- targets: ['pushgateway:9091']
|
2019-04-24 18:18:44 +02:00
|
|
|
|
2019-06-20 02:36:58 +02:00
|
|
|
- job_name: 'blackbox'
|
|
|
|
# ref https://github.com/prometheus/blackbox_exporter#prometheus-configuration
|
|
|
|
metrics_path: /probe
|
|
|
|
params:
|
|
|
|
module: [http_2xx] # Look for a HTTP 200 response.
|
|
|
|
static_configs:
|
|
|
|
- targets:
|
2019-08-06 21:57:50 +02:00
|
|
|
- http://prometheus.io # Target to probe with http.
|
|
|
|
- https://prometheus.io # Target to probe with https.
|
|
|
|
- http://example.com:8080 # Target to probe with http on port 8080.
|
2019-06-20 02:36:58 +02:00
|
|
|
relabel_configs:
|
|
|
|
- source_labels: [__address__]
|
|
|
|
target_label: __param_target
|
|
|
|
- source_labels: [__param_target]
|
|
|
|
target_label: instance
|
|
|
|
- target_label: __address__
|
|
|
|
replacement: 127.0.0.1:9115 # The blackbox exporter's real hostname:port.
|
|
|
|
|
|
|
|
alertmanager:
|
2019-08-06 21:57:50 +02:00
|
|
|
# yamllint disable-line rule:line-length
|
2019-06-20 02:36:58 +02:00
|
|
|
# ref https://github.com/prometheus/alertmanager/blob/master/config/testdata/conf.good.yml
|
|
|
|
global:
|
|
|
|
smtp_smarthost: 'localhost:25'
|
|
|
|
smtp_from: 'alertmanager@example.org'
|
|
|
|
smtp_auth_username: 'alertmanager'
|
|
|
|
smtp_auth_password: "multiline\nmysecret"
|
|
|
|
smtp_hello: "host.example.org"
|
|
|
|
slack_api_url: "http://mysecret.example.com/"
|
|
|
|
http_config:
|
|
|
|
proxy_url: 'http://127.0.0.1:1025'
|
2019-06-22 23:34:37 +02:00
|
|
|
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
|
|
|
|
routes:
|
2019-08-06 21:57:50 +02:00
|
|
|
- match:
|
|
|
|
severity: critical
|
|
|
|
receiver: team-X-mails
|
2019-06-22 23:34:37 +02:00
|
|
|
receivers:
|
2019-08-06 21:57:50 +02:00
|
|
|
- name: 'team-X-mails'
|
|
|
|
email_configs:
|
|
|
|
- to: 'team-X+alerts@example.org'
|
2019-06-20 02:36:58 +02:00
|
|
|
|
2019-06-22 23:34:37 +02:00
|
|
|
inhibit_rules:
|
|
|
|
- name: opsGenie-receiver
|
|
|
|
opsgenie_configs:
|
|
|
|
- api_key: mysecret
|
|
|
|
- name: slack-receiver
|
|
|
|
slack_configs:
|
|
|
|
- channel: '#my-channel'
|
|
|
|
image_url: 'http://some.img.com/img.png'
|
2019-06-20 02:36:58 +02:00
|
|
|
|
|
|
|
linux:
|
2019-08-06 21:57:50 +02:00
|
|
|
# 'Alternatives system' priority: zero disables (default)
|
|
|
|
# yamllint disable-line rule:braces
|
2019-06-26 00:50:23 +02:00
|
|
|
altpriority: {{ range(1, 9100000) | random }}
|
2019-10-04 01:16:27 +02:00
|
|
|
|
|
|
|
exporters:
|
|
|
|
node_exporter:
|
2019-10-04 01:20:16 +02:00
|
|
|
textfile_collectors:
|
|
|
|
ipmitool:
|
|
|
|
# You must enable individual collectors
|
|
|
|
enable: true
|
|
|
|
# pkg: ipmitool
|