added default alerts for nodes
This commit is contained in:
parent
2c33fcc9cf
commit
7997ebfb59
3 changed files with 208 additions and 2 deletions
|
|
@ -62,7 +62,7 @@
|
|||
dest: "/etc/prometheus/targetcerts/{{ inventory_hostname }}.crt"
|
||||
|
||||
- set_fact:
|
||||
labels_ansible_groups: '{ {% for g in group_names %}"ansible_group_{{g}}": True{% if not loop.last %}, {% endif %}{% endfor %} }'
|
||||
labels_ansible_groups: '{ {% for g in group_names %}"ansible_group_{{g}}": 1{% if not loop.last %}, {% endif %}{% endfor %} }'
|
||||
- set_fact:
|
||||
merged_prometheus_labels: "{{ {}|combine((labels_ansible_groups if prometheus_agent.ansible_groups_as_labels else {}), prometheus_agent.labels) }}"
|
||||
- name: setup scraper
|
||||
|
|
@ -71,3 +71,9 @@
|
|||
template:
|
||||
src: node-scraper.j2
|
||||
dest: /etc/prometheus/conf.d/scrape_configs/agent_{{ inventory_hostname }}.conf
|
||||
- name: setup alerts
|
||||
loop: "{{ prometheus_agent.scrapers.keys()|list }}"
|
||||
delegate_to: "{{ item }}"
|
||||
template:
|
||||
src: node-alerts.j2
|
||||
dest: /etc/prometheus/conf.d/rule_files/agent_{{ inventory_hostname }}.conf
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue