Reads and validates Kepler's application environment.
Everything is validated at boot and invalid configuration raises, because the failure mode this prevents — a Kepler that runs happily and delivers nowhere — is the one you would not notice until you needed it.
config :kepler,
watches: MyApp.Watches,
sinks: [{Kepler.Sink.Webhook, url: System.fetch_env!("KEPLER_WEBHOOK_URL")}]Keys
:enabled— set tofalseto start the supervision tree without installing anything. Defaults totrue.:watches— a module usingKepler, or a list of them.:sinks— a keyword list ofname: spec, where spec is aKepler.Sink.spec/0. Watches route to sinks by name. An empty list logs a warning at boot: watches with no sink evaluate and then discard.:tick— milliseconds between evaluation passes. Defaults to1_000. Below100is refused; that is a poller, not a profiler.:buffer— emitter limits.:max_size(default500),:drop(:oldestor:newest, default:oldest),:max_in_flight(default4), and:delivery_timeout(default15_000ms), after which a sink that has stopped responding is killed rather than holding an in-flight slot forever.:budget— self-limiting.:shareis the fraction of one node's compute Kepler may use before shedding, default0.01.:shed_afterand:restore_afterare how many consecutive ticks over or under the limit it takes to act, defaulting to3and10.:max_tickcaps the slowed-down interval, default 30 seconds. Setshare: :infinityto disable shedding.:system_monitor—:takeoverdecides what to do when something else already holds the node's single system monitor. Defaults tofalse, which yields and logs rather than stomping:observeror:recon.
Summary
Functions
Builds a validated config from the application environment.
Types
@type t() :: %Kepler.Config{ budget: %{ share: float() | :infinity, shed_after: pos_integer(), restore_after: pos_integer(), max_tick: pos_integer() }, buffer: %{ max_size: pos_integer(), drop: :oldest | :newest, max_in_flight: pos_integer(), delivery_timeout: pos_integer() }, enabled: boolean(), sinks: keyword(Kepler.Sink.spec()), system_monitor: %{takeover: boolean()}, tick: pos_integer(), watches: [module()] }