One thing GET /ready asks about (Ankusa.Health).
A check says whether it applies?/1 to this node's config (a node with no
store has no store check, a threshold left nil switches its check off),
whether a failure of it makes the node unready (gates?/1), and run/1s
itself. all/0 is the registry, in the order the body lists them:
Ankusa.Health.Check.Drain: the node is being stopped (Ankusa.Health.drain/1). Only present while it is; reportsdraining. Gates.Ankusa.Health.Check.Store: the store takes a synced write. Gates.Ankusa.Health.Check.Intake: thewal: :dualintake log answers. Gates.Ankusa.Health.Check.Sinks: underwal: :none, no sink failed its last publish withinlistener.ready_sink_error_window_ms. Gates.Ankusa.Health.Check.Disk:listener.ready_min_free_bytesofdata_dir's file system are free. Gates.Ankusa.Health.Check.Backlog: the oldest due row has waited no longer thanqueue.max_oldest_due_ms. A label: never makes the node unready.Ankusa.Health.Check.Backup: the last backup is younger thanbackup.max_age_ms. Gates only withbackup.require_fresh.
run/1 answers :ok, {:failing, reason} or {:draining, reason}, the
reason an atom from a fixed set per check (it reaches the /ready body, so
it never carries an error term). A check must not hold a request longer than a
readiness probe waits: bound every call it makes.
Summary
Callbacks
Whether this node's config has the check run at all.
Whether a check that is not :ok makes the node unready (503).
The key the check's state has in the /ready body.
Functions
Every check, in body order.
Run check. A check that raises, exits or throws is failing with reason
:error: readiness never crashes the probe, and a check that cannot answer
must not read as healthy.
Types
Callbacks
@callback applies?(Ankusa.Config.t()) :: boolean()
Whether this node's config has the check run at all.
@callback gates?(Ankusa.Config.t()) :: boolean()
Whether a check that is not :ok makes the node unready (503).
@callback name() :: atom()
The key the check's state has in the /ready body.
@callback run(Ankusa.Config.t()) :: result()
Functions
@spec all() :: [module()]
Every check, in body order.
@spec run(module(), Ankusa.Config.t()) :: result()
Run check. A check that raises, exits or throws is failing with reason
:error: readiness never crashes the probe, and a check that cannot answer
must not read as healthy.