Closed Ninigi closed 1 year ago
this is kinda questionable...
we say that PromEx should be started before Repo module.
Yet, this PR suggests staring PromEx after Endpoint which is usually started as the last thing since it quite often depends on other processes being already running.
Even the freshly generated phoenix app (source: https://www.phoenixdiff.org/?source=1.6.15&source_variant=default&target=1.7.2&target_variant=default) looks like this:
def start(_type, _args) do
children = [
# Start the Telemetry supervisor
SampleAppWeb.Telemetry,
# Start the Ecto repository
SampleApp.Repo,
# Start the PubSub system
{Phoenix.PubSub, name: SampleApp.PubSub},
# Start Finch
{Finch, name: SampleApp.Finch},
# Start the Endpoint (http/https)
SampleAppWeb.Endpoint
# Start a worker by calling: SampleApp.Worker.start_link(arg)
...
Am I missing something?
If you start PromEx before the Endpoint, it will raise an error
RuntimeError: ** (RuntimeError) could not find persistent term for endpoint
at least once, until the Endpoint started.It works, but can pollute your logs (and will be very annoying if you have something like AppSignal running in production)
Issue number: #194