kolla-ansible/ansible/roles/prometheus/templates/prometheus.yml.j2
Mathias Ewald 4d1f37359d Add role to deploy prometheus
This patch adds the ansible role to deploy the prometheus service which
can be used to collect performance metrics accross the environment

Partially-Implements: blueprint prometheus
Change-Id: I908b9c9dad63ab5c9b80be1e3a80a4fc8191cb9e
2018-04-19 10:58:15 -04:00

42 lines
1.4 KiB
Django/Jinja

global:
scrape_interval: 60s
scrape_timeout: 10s
evaluation_interval: 15s
external_labels:
monitor: 'kolla'
scrape_configs:
- job_name: prometheus
static_configs:
- targets:
{% for host in groups['prometheus'] %}
- '{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ prometheus_port }}'
{% endfor %}
{% if enable_prometheus_node_exporter | bool %}
- job_name: node
static_configs:
- targets:
{% for host in groups['prometheus-node-exporter'] %}
- '{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ hostvars[host]['prometheus_node_exporter_port'] }}'
{% endfor %}
{% endif %}
{% if enable_prometheus_mysqld_exporter | bool %}
- job_name: mysqld
static_configs:
- targets:
{% for host in groups['prometheus-mysqld-exporter'] %}
- '{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ hostvars[host]['prometheus_mysqld_exporter_port'] }}'
{% endfor %}
{% endif %}
{% if enable_prometheus_haproxy_exporter | bool %}
- job_name: haproxy
static_configs:
- targets:
{% for host in groups['prometheus-haproxy-exporter'] %}
- '{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ hostvars[host]['prometheus_haproxy_exporter_port'] }}'
{% endfor %}
{% endif %}