Is your proposal related to a problem?
thanos rule supports reloading rule files via SIGHUP or POST /-/reload, but it does not automatically detect updates to files specified by --rule-file.
This is particularly inconvenient in Kubernetes environments where rule files are managed via ConfigMap or Secret. Even when a mounted file is updated automatically, thanos rule does not pick up the change on its own, so users still need an external reloader sidecar just to detect the file change and call /-/reload.
The --rule-file flag description itself also notes this current limitation:
Note that rules are not automatically detected, use SIGHUP or do HTTP POST /-/reload to re-read them.
Describe the solution you'd like
It would be very helpful if thanos rule had a native auto-reload mechanism for files specified by --rule-file.
For example, an optional mechanism that:
- watches rule files on disk
- detects updates automatically
- reloads rules without requiring an external sidecar
- keeps the current behavior if the updated rule files are invalid
A feature similar in spirit to Prometheus --enable-feature=auto-reload-config would be ideal.
Describe alternatives you've considered
The current workaround is to use an external reloader sidecar or watcher process that detects file changes and then triggers SIGHUP or POST /-/reload.
This works, but it adds operational complexity, especially in Kubernetes deployments where mounted ConfigMap / Secret updates are common.
I also looked at existing behavior in other Thanos components. Notably, thanos receive already supports automatic reload for --receive.hashrings-file, so there is already a precedent in Thanos for native file-watching and dynamic reload behavior.
Additional context
This would be especially useful for Kubernetes deployments where rule files are updated through mounted ConfigMaps or Secrets.
It would also make thanos rule more consistent with other systems that already support native config/rule auto-reload.
Reference for the Prometheus feature mentioned above:
Prometheus: Auto Reload Config
Is your proposal related to a problem?
thanos rulesupports reloading rule files viaSIGHUPorPOST /-/reload, but it does not automatically detect updates to files specified by--rule-file.This is particularly inconvenient in Kubernetes environments where rule files are managed via ConfigMap or Secret. Even when a mounted file is updated automatically,
thanos ruledoes not pick up the change on its own, so users still need an external reloader sidecar just to detect the file change and call/-/reload.The
--rule-fileflag description itself also notes this current limitation:Describe the solution you'd like
It would be very helpful if
thanos rulehad a native auto-reload mechanism for files specified by--rule-file.For example, an optional mechanism that:
A feature similar in spirit to Prometheus
--enable-feature=auto-reload-configwould be ideal.Describe alternatives you've considered
The current workaround is to use an external reloader sidecar or watcher process that detects file changes and then triggers
SIGHUPorPOST /-/reload.This works, but it adds operational complexity, especially in Kubernetes deployments where mounted ConfigMap / Secret updates are common.
I also looked at existing behavior in other Thanos components. Notably,
thanos receivealready supports automatic reload for--receive.hashrings-file, so there is already a precedent in Thanos for native file-watching and dynamic reload behavior.Additional context
This would be especially useful for Kubernetes deployments where rule files are updated through mounted ConfigMaps or Secrets.
It would also make
thanos rulemore consistent with other systems that already support native config/rule auto-reload.Reference for the Prometheus feature mentioned above:
Prometheus: Auto Reload Config