Retro.Phoenix.Plug.HealthCheck (Retro v2.2.0) View Source
Health checks can be used for liveness or readiness probes.
Health checks are separated from the functionality of the application, because of that, it's better to minimize the impact on application.
They should meet the following requirements:
- run as light as possible.
- not generate logs.
Usage
The basic idea is adding it to the top of plugs.
Add it to the top of endpoint.ex
in Phoenix:
defmodule HelloWeb.Endpoint do
use Phoenix.Endpoint, otp_app: :hello
# Put the health check here, before anything else
plug Retro.Phoenix.Plug.HealthCheck
end