iapetos.collector.fn
initialize
(initialize registry)
Enable function instrumentalization by registering the metric collectors. Metrics include:
fn_duration_seconds
: a histogram of execution duration,fn_last_failure_unixtime
: a gauge with the last failure timestamp,fn_runs_total
: a counter for fn runs, split by success/failure,fn_exceptions_total
: a counter for fn exceptions, split by class.
instrument!
(instrument! registry fn-var)
(instrument! registry fn-var {:keys [fn-name exceptions? duration? last-failure? run-count?], :or {fn-name (subs (str fn-var) 2)}, :as options})
wrap-instrumentation
(wrap-instrumentation f registry fn-name {:keys [duration? exceptions? last-failure? run-count?], :or {duration? true, exceptions? true, last-failure? true, run-count? true}})
Wrap the given function to write a series of execution metrics to the given registry. See initialize.