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 uprule_files does not seem to detect file changes #4235
Comments
This comment has been minimized.
This comment has been minimized.
|
You need to reload Prometheus's configuration for changes to rules to take effect, just as for prometheus.yml changes. |
This comment has been minimized.
This comment has been minimized.
|
I'm aware of that, which is why I have made a proposal to add file change detection. |
This comment has been minimized.
This comment has been minimized.
|
The problem with that is that it wouldn't allow for atomic changes of multiple files, which is why it's currently tied into the general reload logic. |
This comment has been minimized.
This comment has been minimized.
|
I don't mind the general reload. Would it be a problem if changes to any of the change monitored files/patterns caused a general reload? That would keep it atomic... |
This comment has been minimized.
This comment has been minimized.
|
Yes, that'd also prevent users from doing a multi-file atomic change as the first file changed would trigger a reload before the rest were done. |
This comment has been minimized.
This comment has been minimized.
|
I understand what you are saying, but I'm not convinced that this is actually a problem. If I remember correctly the docs say that, whenever the config is not valid on a reload, it will not change the running configuration. Therefore an inconsistent multi-file change should not break anything. Also, usually file monitors triggers use some debouncing/quiet wait time which also mitigates this kind of issues. |
This comment has been minimized.
This comment has been minimized.
|
It is a problem, say I want to replace file a.rules with b.rules. That's not possible atomically with your suggestion.
That makes it into a race condition, which isn't much better. In addition you'd be breaking all the users who depend on the current documented behaviour. |
This comment has been minimized.
This comment has been minimized.
|
@avonwyss if you use tools that generate these, can't it send a reload request to Prom as well? |
This comment has been minimized.
This comment has been minimized.
|
@krasi-georgiev Of course I can create some mechanism to trigger the reload externally, but I try to keep the tools and systems as decoupled as possible. Since file monitoring actually exists in other places of the configuration it did not seem to be such a far-fetched idea. |
This comment has been minimized.
This comment has been minimized.
To me it seems logical that the same tool that generates the config should be responsible for actually enabling the new config. And @brian-brazil's argument about the race condition is a rather big blocker against changing the current behaviour. |
This comment has been minimized.
This comment has been minimized.
|
PSA: We need that atomic change thing. To us changing that would cause troubles. |
This comment has been minimized.
This comment has been minimized.
|
Since this proposal has apparently significant problem potential I'm closing it. |
avonwyss
closed this
Jun 10, 2018
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 22, 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. |
avonwyss commentedJun 7, 2018
Proposal
Use case. Why is this important?
Changes to rule files specified in
rule_filesshould ideally take effect automatically, without the need to trigger a configuration reload manually. This would allow external tools/scripts to generate of modify these files without requiring direct interaction with Prometheus.I would expect it to behave the same as
scrape_configs.*.file_sd_configs.fileswhich detects file changes as well as new files when using a wildcard.