Skip to content

Commit

Permalink
enhancement(prometheus): support prometheus2 .yml rule file format
Browse files Browse the repository at this point in the history
  • Loading branch information
dpavle committed Apr 15, 2024
1 parent 5de1a16 commit 4be7163
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions roles/prometheus/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,14 @@ argument_specs:
prometheus_alert_rules:
description:
- "Full list of alerting rules which will be copied to C({{ prometheus_config_dir }}/rules/ansible_managed.rules)."
- "Alerting rules can be also provided by other files located in C({{ prometheus_config_dir }}/rules/) which have C(*.rules) extension"
- "Alerting rules can be also provided by other files located in C({{ prometheus_config_dir }}/rules/) which have a C(*.rules) or C(*.rules.yml) extension"
- "Please see default values in role defaults/main.yml"
type: "list"
elements: "dict"
prometheus_alert_rules_files:
description:
- "List of folders where ansible will look for files containing alerting rules which will be copied to C({{ prometheus_config_dir }}/rules/)."
- "Files must have C(*.rules) extension"
- "Files must have a C(*.rules) or C(*.rules.yml) extension"
type: "list"
elements: "str"
default:
Expand Down
1 change: 1 addition & 0 deletions roles/prometheus/templates/prometheus.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ remote_read:
{% if not prometheus_agent_mode and prometheus_alert_rules_files != [] %}
rule_files:
- {{ prometheus_config_dir }}/rules/*.rules
- {{ prometheus_config_dir }}/rules/*.rules.yml
{% endif %}

{% if prometheus_alertmanager_config | length > 0 %}
Expand Down

0 comments on commit 4be7163

Please sign in to comment.