Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upPrometheus fails to recursively load alert rules #3546
Comments
This comment has been minimized.
This comment has been minimized.
|
This behaviour is as expected, only the last component of the path can be a glob. |
This comment has been minimized.
This comment has been minimized.
|
By "only the last component of the path can be a glob" do you mean the
|
This comment has been minimized.
This comment has been minimized.
|
There's also globbing in file_sd_configs, which globbing like that won't work for due to inotify. |
This comment has been minimized.
This comment has been minimized.
|
Which is handled separately from this or did I miss something? |
This comment has been minimized.
This comment has been minimized.
|
Hmm, good point. I think it'd be actually ok for rule files, as we have removed inotify-based config reloading a long time ago. But we still use inotify watches for |
This comment has been minimized.
This comment has been minimized.
|
Yeah, I think consistency is the better choice here. |
brian-brazil
added
component/rules
priority/Pmaybe
labels
Dec 8, 2017
This comment has been minimized.
This comment has been minimized.
|
Dupe of #2487? |
brian-brazil
closed this
Dec 19, 2017
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 23, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
svs1979 commentedDec 5, 2017
What did you do?
I'd like to load alerts from several subdirectories which are not known in advance. Therefore I created a directory
/etc/prometheus/alerts.dwhere I'll have an amount of subdirectories containing the alert rules.In Prometheus (2.0.0), I've configured
For testing, I created a structure like that:
What did you expect to see?
I'd expect Prometheus to load all of the above rule files
What did you see instead? Under which circumstances?
Prometheus failed to start, giving the error message
level=error ts=2017-12-05T11:49:35.305604677Z caller=main.go:356 msg="Error loading config" err="couldn't load configuration (--config.file=/etc/prometheus/prometheus.yaml): invalid rule file path \"/etc/prometheus/alerts.d/*/*.yml\""The problem in the sources is that there is an explicit check on the
rule_filesconfiguration preventing recursion:(in config/config.go:34). The underlying filepath.Glob() used for resolving the pattern seems to support recursion, though.
Environment
System information:
Linux 3.16.0-4-amd64 x86_64
Prometheus version: