fettle v1.0.0 Fettle.Supervisor View Source
The Fettle supervisor starts two servers; Fettle.ScoreBoard a
GenServer which responds to queries about the current health status,
and Fettle.RunnerSupervisor a supervisor which starts worker Fettle.Runner servers
running the health-checks themselves, and takes care of restarting them if they
exit abnormally.
The RunnerSupervisor starts a worker process for each configured
Health.Spec, configuring them so they report results back to
the ScoreBoard process.
Supervision Tree
Fettle.Supervisor
- Registry (
Fettle.Registry) - Fettle.ScoreBoard
Fettle.RunnerSupervisor
- Fettle.Runner
- Registry (
Config
By default Fettle loads configuration from the :fettle OTP application key;
alternatively you can pass a :config option with either a {M,F,A},
a zero-args anonymous function, or some in-line configuration as a Keyword list:
Fettle.Supervisor.start_link(config: {MyMod, :fettle, []}) # calls `MyMod.fettle/0`
# or
Fettle.Supervisor.start_link(config: [
system_code: "app",
name: "My Application",
checks: [...]
]) # inline config
See Fettle.Config for format details.
When using application configuration under the
:fettlekey, Fettle uses DeferredConfig to resolve{:system, "ENV_VAR"}style tuples using shell enviroment variables; this works for all config values: values will be automatically cast to integers as required.