2024-12-22 12:54:26 +00:00
|
|
|
Signal options are provided as a map with COMPILE-TIME keys.
|
2025-02-27 09:00:05 +00:00
|
|
|
All options are available for all signal creator calls:
|
2024-03-11 08:49:56 +00:00
|
|
|
|
2024-08-05 10:59:18 +00:00
|
|
|
`:inst` -------- Platform instant [1] when signal was created, ∈ #{nil :auto <[1]>}
|
2024-04-12 12:57:24 +00:00
|
|
|
`:level` ------- Signal level ∈ #{<int> :trace :debug :info :warn :error :fatal :report ...}
|
2024-08-05 10:59:18 +00:00
|
|
|
`:kind` -------- Signal ?kind ∈ #{nil :event :error :log :trace :spy <app-val> ...}
|
2024-04-12 12:57:24 +00:00
|
|
|
`:id` ---------- ?id of signal (common to all signals created at callsite, contrast with `:uid`)
|
|
|
|
|
`:uid` --------- ?id of signal instance (unique to each signal created at callsite, contrast with `:id`)
|
2024-09-04 12:43:55 +00:00
|
|
|
Defaults to `:auto` for tracing signals, and nil otherwise
|
2024-03-11 08:49:56 +00:00
|
|
|
|
2024-10-30 14:33:09 +00:00
|
|
|
`:msg` --------- Arb app-level ?message to incl. in signal: str or vec of strs to join (with `\space`), may be a delay
|
2025-11-28 08:59:35 +00:00
|
|
|
`:data` -------- Arb app-level ?data to incl. in signal: usu. a map, LAZY! [3]
|
2024-08-05 10:59:18 +00:00
|
|
|
`:error` ------- Arb app-level ?error to incl. in signal: platform error [2]
|
2024-03-11 08:49:56 +00:00
|
|
|
|
2024-12-20 13:44:34 +00:00
|
|
|
`:run` --------- ?form to execute UNCONDITIONALLY; will incl. `:run-val` in signal
|
2025-11-28 08:59:35 +00:00
|
|
|
`:do` ---------- ?form to execute conditionally (iff signal allowed) and LAZILY [3], before establishing `:let` ?binding
|
|
|
|
|
`:let` --------- ?bindings to establish conditionally (iff signal allowed) and LAZILY [3], BEFORE evaluating `:data` and `:msg` (useful!)
|
2024-03-11 08:49:56 +00:00
|
|
|
|
2024-08-12 12:34:54 +00:00
|
|
|
`:parent` ------ Custom ?{:keys [id uid]} to override auto (dynamic) parent signal tracing info
|
|
|
|
|
`:root` -------- Custom ?{:keys [id uid]} to override auto (dynamic) root signal tracing info
|
2024-10-11 08:51:16 +00:00
|
|
|
`:ctx` --------- Custom ?val to override auto (dynamic `*ctx*`) in signal, as per `with-ctx`
|
|
|
|
|
`:ctx+` -------- Custom ?val to update auto (dynamic `*ctx*`) in signal, as per `with-ctx+`
|
2024-03-11 08:49:56 +00:00
|
|
|
|
2025-02-27 09:00:05 +00:00
|
|
|
`:ns` ---------- Custom ?str namespace to override auto signal callsite info
|
|
|
|
|
`:coords` ------ Custom ?[line column] to override auto signal callsite info
|
2025-02-26 18:08:44 +00:00
|
|
|
|
2025-03-10 21:31:54 +00:00
|
|
|
`:elidable?` --- Should signal be subject to compile-time elision? (default true)
|
2025-05-14 08:17:46 +00:00
|
|
|
`:allow?` ------ Custom override for usual runtime filtering (true => ALWAYS create signal)
|
2025-03-10 07:53:06 +00:00
|
|
|
`:trace?` ------ Should tracing be enabled for `:run` form?
|
|
|
|
|
|
2025-03-10 21:31:54 +00:00
|
|
|
`:sample` ------ Sample ?rate ∈ℝ[0,1] for random signal sampling (0.75 => allow 75% of signals, nil => allow all)
|
2024-04-12 12:57:24 +00:00
|
|
|
`:when` -------- Arb ?form; when present, form must return truthy to allow signal
|
2025-03-10 10:01:08 +00:00
|
|
|
`:limit` ------- Rate limit ?spec given to `taoensso.telemere/rate-limiter`, see its docstring for details
|
|
|
|
|
`:limit-by` ---- When present, rate limits will be enforced independently for each value (any Clojure value!)
|
2025-03-10 07:53:06 +00:00
|
|
|
`:xfn` --------- Optional transform (fn [signal]) => ?modified-signal to apply when signal is created, as per `with-xfn`
|
|
|
|
|
`:xfn+` -------- Optional extra transform (fn [signal]) => ?modified-signal to apply when signal is created, as per `with-xfn+`
|
2024-03-11 08:49:56 +00:00
|
|
|
|
2024-08-05 10:59:18 +00:00
|
|
|
<kvs> ---------- Other arb app-level ?kvs to incl. in signal. Typically NOT included in
|
2024-04-25 07:37:55 +00:00
|
|
|
handler output, so a great way to provide custom data/opts for use
|
2025-11-28 08:59:35 +00:00
|
|
|
(only) by custom transforms/handlers. LAZY! [3]
|
2024-04-25 07:37:55 +00:00
|
|
|
|
2024-03-11 08:49:56 +00:00
|
|
|
If anything is unclear, please ping me (@ptaoussanis) so that I can improve these docs!
|
|
|
|
|
|
2024-03-28 12:18:00 +00:00
|
|
|
[1] `java.time.Instant` or `js/Date`
|
|
|
|
|
[2] `java.lang.Throwable` or `js/Error`
|
2025-11-28 08:59:35 +00:00
|
|
|
[3] Most Telemere signal content is evaluated CONDITIONALLY (iff signal allowed),
|
|
|
|
|
LAZILY (when signal is created), and on the HANDLING THREAD (not logging thread).
|
|
|
|
|
This allows efficient filtering, better control+monitoring of back pressure,
|
|
|
|
|
conditional effects, etc. Ref. <https://www.taoensso.com/telemere/flow> for visual!
|