Skip to content

Exporter is not available after restarting PrometheusTelemetry #24

Description

@janpieper

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions