Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement(prometheus): support prometheus2 .yml rule file format #333

Merged
merged 8 commits into from
Oct 31, 2024
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
dpavle marked this conversation as resolved.
Show resolved Hide resolved
{% endif %}

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