-
Notifications
You must be signed in to change notification settings - Fork 138
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
Prometheus custom rules not copying to rules folder #484
Comments
Do you by any chance have |
I left the variable configured with the default list here. I also additionally tested an override where I had it configured as a list and it did not seem to make a difference in this case. |
Hmm, what does your playbook look like? And can you show me the debug log of the task? |
PlaybookStored in playbooks -> prometheus -> prometheus.yml - hosts: prometheus
remote_user: root
roles:
- prometheus.prometheus.prometheus
tags: [prometheus]
vars:
prometheus_version: "{{ prometheus.version }}"
prometheus_storage_retention: "1w"
prometheus_db_dir: /var/lib/prometheus
prometheus_config_flags_extra:
storage.tsdb.min-block-duration: 2h
storage.tsdb.max-block-duration: 2h
web.enable-admin-api:
storage.tsdb.allow-overlapping-blocks:
prometheus_alertmanager_config:
- scheme: http
static_configs:
- targets: ["{{ alert_manager_url }}"]
prometheus_alert_rules: []
prometheus_alert_relabel_configs: []
prometheus_external_labels:
clusterName: "production"
prometheus_targets:
linux:
- targets:
- {{ exampleHostname }}:{{ port }}
- {{ exampleHostname }}:{{ port }} I have the prometheus rules setup like so... (In the new rule format) The debugging did not output a single thing unfortunately, I tried it with
|
Can confirm. |
Found the cause: In this PR support for rule files with file ending .rules was removed. This was not mentioned in changelog / release notes. |
Renaming my rules files from .rules to .yml alone did not fix my issue. 1e4e4c3#diff-a405b871a41e1b77e6d93c308fb136fd60b40efa6e85917adbde90a8fb9a0f16R93 This change is also problematic. In other words: I can confirm the conclusion of @cdestouni-fmp |
Setup
I upgraded to the latest release v0.23.0 and run the Prometheus role to configure Prometheus on a Ubuntu 22 virtual machine. My custom rules are located in
prometheus/rules/*yml
location and my files all end with the.yml
extension as expected by the default variableprometheus_alert_rules_files
.Configuration
I 'm running the role using the below ansible configuration.
And the below OS configuration
Deploying to the below OS configuration
Problem
The Copy custom alerting rule files did not copy over my custom rules to the rules directory on the Prometheus server. There was no feedback, even in verbose mode
-vvvv
so I assumed the glob working correctly and it thinks there's no files to copy over. After the role completed, the Prometheus server was running but no custom rules were displayed in the UI.Testing done
I tried to override the
prometheus_alert_rules_files
variable with a new location (In the expected list format). This resulted in an error of not locating the files instead of the original no feedback, which makes me think the location is not the problem.I tested at v0.19.0 before this task was last changed and it works fine and copied the custom rules over as expected.
I tried the v0.23.0 task changes but using
root
permissions on the copy task which did not make a difference. This means it is not a permissions issue.Conclusion
This leaves me to think the problem is situated in the change below.
Working version (v0.19.0)
Not working version (v0.23.0)
Please let me know if you can help resolve this.
The text was updated successfully, but these errors were encountered: