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

signal to reload changes within queryDir #23

Open
andybrown668 opened this issue Aug 2, 2017 · 7 comments
Open

signal to reload changes within queryDir #23

andybrown668 opened this issue Aug 2, 2017 · 7 comments

Comments

@andybrown668
Copy link
Contributor

Thank you for this work!

I use this in a production environment and deploy changes to contents of a queries folder with ansible.
But I currently need to restart the prometheus-sql container to make it notice the changed queries.

It'd be great if prometheus-sql could respond to a signal (SIGINT?) and reload the queries.

cheers
Andy

@bruth
Copy link
Contributor

bruth commented Aug 2, 2017

Good suggestion. I have actually run into this myself. This is a good idea. Another option is to add a -watch flag to automatically reload on detected changes (fsnotify or something similar could be used).

@andybrown668
Copy link
Contributor Author

Would the fsnotify idea force users into atomically copying the changed configs? (like a copy-to-temp then rename to .yml).
I like the idea anyway, and requiring the -watch flag makes it a nice opt-in.
So there's no duplication of effort, would you like me to take a look at coming up with a PR? (work's always busy but we've had a huge speed-up from all the open source software out here)

@bruth
Copy link
Contributor

bruth commented Aug 3, 2017

@andybrown668 Yes good point. I suppose if only the config files are being watched then any queries in a directory or file could be updated prior to "touching" the config files to trigger the change. Or the primary config could be the only thing that triggers the reload.

That being said, the SIGHUP solution is simpler and likely preferred because of this case. That would be great if you could investigate this!

@andybrown668
Copy link
Contributor Author

cool - please give me a week to come up with something; could be sooner, but I don't want to overpromise or block someone else contributing if I'm too slow getting it done

@haxorof haxorof added this to the 1.3.0 milestone Aug 5, 2017
@haxorof haxorof removed this from the 1.3.0 milestone Sep 24, 2017
@mscifo
Copy link

mscifo commented Sep 30, 2017

I just whipped this up to handle this issue
https://github.com/mscifo/prometheus-sql-config

@bruth
Copy link
Contributor

bruth commented Oct 1, 2017

@mscifo Nice solution!

@simonpie
Copy link

Another solution that would be useful would be to have a rest end point to force reload like prometheus. Then, one can use a side container in kubernetes to reload the main one on config map change :
https://github.com/jimmidyson/configmap-reload

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants