ricoberger / script_exporter

Prometheus exporter to execute scripts and collect metrics from the output or the exit status.
MIT License
344 stars 79 forks source link

New TLS certificates (e.g. renewal) do not automatically get loaded (even on SIGHUP) #150

Open shric opened 1 month ago

shric commented 1 month ago

We automatically renew TLS certificates periodically and need to restart script_exporter to pick up the new certs. Other exporters such as node-exporter and snmp-exporter automatically pick up the latest cert file due to using the exporter-toolkit.

I noticed in https://github.com/ricoberger/script_exporter/issues/44 you commented in 2021 that you didn't want to introduce an additional configuration file for TLS, and therefore didn't want to use the exporter toolkit. However, I've noticed that since then you've supported separate config files for different scripts etc. so perhaps you're less reluctant to split today?

I believe using the exporter-toolkit would solve both https://github.com/ricoberger/script_exporter/issues/44 and this issue.

A large number of Go-based Prometheus things (e.g. prometheus and alertmanager themselves, node-exporter, snmp-exporter, etc.) use it, so users can point to a single web-config.yml.

If you have an interest in moving to use the toolkit but don't have the time or inclination to do so, I may attempt to send you a PR if you're open to the change, keen to know your thoughts.

ricoberger commented 1 month ago

Hi @shric, I want to some major changes (mainly flag handling and some config stuff) since a long time so I think it would also be a good point to take a closer look at the exporter toolkit.

I will have a look at it within the next week(s). If you already want to come up with a PR which adds the exporter-toolkit, feel free to do so. It would be very welcome 🙂