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:

  1. run as light as possible.
  2. not generate logs.


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


Link to this section Summary

Link to this section Functions