SuperQ / smokeping_prober

Prometheus style smokeping
Apache License 2.0
554 stars 73 forks source link

reload config on `SIGHUP` & `/-/reload`, implement `/-/healthy` #121

Closed carlosrodfern closed 5 months ago

carlosrodfern commented 10 months ago

Fixes: #118

SuperQ commented 8 months ago

Hmm, I'm not sure I like re-exec as a way to do this.

carlosrodfern commented 7 months ago

@SuperQ , do you have any specific concern about the approach? I may be able to look into it.

This is not an uncommon solution in Unix, but I noticed that in the prometheus related programs world, the most common solution is purely programmatically resetting the state manually. However, I'm not sure that approach is followed because of some analysis of tradeoffs between re-exec or programmatic in every case. I understand if you prefer to close this PR, and look into a solution more aligned with the rest of prometheus related programs for uniformity, or into a solution that fulfills some functional requirements better.

carlosrodfern commented 5 months ago

While dealing with another program, I thought of something. It would be best if the HUP signal would try to reload the config, and if it fails, keep using the previous one while outputting the error. That's not solved in this PR. Let me see if I can work on a better solution here.

SuperQ commented 5 months ago

Yes, take a look at some of the other Prometheus exporters that support SIGHUP. There are some reasonable reload patterns.

carlosrodfern commented 5 months ago

I also included a commit for /-/healthy and /-/reload

SuperQ commented 5 months ago

Looks like there's a minor lint issue.