When starting PrometheusTelemetry it does a :persistent_term.put/2:
|
:persistent_term.put(@exporter_enabled_key, [port | :persistent_term.get(@exporter_enabled_key, [])]) |
But there is currently no way to correctly stop it again. When using Supervisor.stop(pid) it stops the supervisor, but the :persistent_term key won't be updated. So, when restarting PrometheusTelemetry, the :__exporter_ports__ still contains the port that is not used anymore, which prohibits starting the exporter again.
Before restaring PrometheusTelemetry, we currently need to do this:
Supervisor.stop(pid)
:persistent_term.put(:__exporter_ports__, :persistent_term.get(:__exporter_ports__) -- [port])
Would be cool to have a stop function for this which takes care about removing the port from the persistent term.
When starting
PrometheusTelemetryit does a:persistent_term.put/2:prometheus_telemetry_elixir/lib/prometheus_telemetry.ex
Line 149 in 1dbd353
But there is currently no way to correctly stop it again. When using
Supervisor.stop(pid)it stops the supervisor, but the:persistent_termkey won't be updated. So, when restartingPrometheusTelemetry, the:__exporter_ports__still contains the port that is not used anymore, which prohibits starting the exporter again.Before restaring
PrometheusTelemetry, we currently need to do this:Would be cool to have a stop function for this which takes care about removing the port from the persistent term.