Closed carlosrodfern closed 5 months ago
Hmm, I'm not sure I like re-exec as a way to do this.
@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.
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.
Yes, take a look at some of the other Prometheus exporters that support SIGHUP. There are some reasonable reload patterns.
I also included a commit for /-/healthy
and /-/reload
Looks like there's a minor lint issue.
Fixes: #118