mirror of
https://github.com/taoensso/telemere.git
synced 2025-12-17 01:51:10 +00:00
[nop] Misc housekeeping
This commit is contained in:
parent
847781e1e8
commit
b56f7c4908
14 changed files with 34 additions and 32 deletions
|
|
@ -8,7 +8,7 @@
|
||||||
:url "https://www.eclipse.org/legal/epl-v10.html"}
|
:url "https://www.eclipse.org/legal/epl-v10.html"}
|
||||||
|
|
||||||
:dependencies
|
:dependencies
|
||||||
[[com.taoensso/encore "3.99.0"]]
|
[[com.taoensso/encore "3.100.0"]]
|
||||||
|
|
||||||
:test-paths ["test" #_"src"]
|
:test-paths ["test" #_"src"]
|
||||||
|
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
[[org.clojure/test.check "1.1.1"]
|
[[org.clojure/test.check "1.1.1"]
|
||||||
[org.clojure/tools.logging "1.3.0"]
|
[org.clojure/tools.logging "1.3.0"]
|
||||||
[org.slf4j/slf4j-api "2.0.12"]
|
[org.slf4j/slf4j-api "2.0.12"]
|
||||||
[com.taoensso/slf4j-telemere "1.0.0-alpha2"]
|
[com.taoensso/slf4j-telemere "1.0.0-alpha4"]
|
||||||
;; [org.slf4j/slf4j-simple "2.0.12"]
|
;; [org.slf4j/slf4j-simple "2.0.12"]
|
||||||
;; [org.slf4j/slf4j-nop "2.0.12"]
|
;; [org.slf4j/slf4j-nop "2.0.12"]
|
||||||
[io.opentelemetry/opentelemetry-api "1.37.0"]
|
[io.opentelemetry/opentelemetry-api "1.37.0"]
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ Tips:
|
||||||
- `error` arg is a platform error (`java.lang.Throwable` or `js/Error`).
|
- `error` arg is a platform error (`java.lang.Throwable` or `js/Error`).
|
||||||
- Can conveniently be wrapped by `throw`: (throw (error! ...)).
|
- Can conveniently be wrapped by `throw`: (throw (error! ...)).
|
||||||
|
|
||||||
[1] See `help:signal-handling` docstring
|
----------------------------------------
|
||||||
|
[1] See `help:signal-flow` docstring
|
||||||
[2] See `help:signal-content` docstring
|
[2] See `help:signal-content` docstring
|
||||||
[3] See `help:signal-options` docstring
|
[3] See `help:signal-options` docstring
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,6 @@ Tips:
|
||||||
position, and for `event!` that's the `level-or-opts` arg.
|
position, and for `event!` that's the `level-or-opts` arg.
|
||||||
|
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
[1] See `help:signal-handling` docstring
|
[1] See `help:signal-flow` docstring
|
||||||
[2] See `help:signal-content` docstring
|
[2] See `help:signal-content` docstring
|
||||||
[3] See `help:signal-options` docstring
|
[3] See `help:signal-options` docstring
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,6 @@ Tips:
|
||||||
- See also `msg-splice`, `msg-skip` utils.
|
- See also `msg-splice`, `msg-skip` utils.
|
||||||
|
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
[1] See `help:signal-handling` docstring
|
[1] See `help:signal-flow` docstring
|
||||||
[2] See `help:signal-content` docstring
|
[2] See `help:signal-content` docstring
|
||||||
[3] See `help:signal-options` docstring
|
[3] See `help:signal-options` docstring
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,6 @@ Tips:
|
||||||
- Supports the same options as other signals [3].
|
- Supports the same options as other signals [3].
|
||||||
|
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
[1] See `help:signal-handling` docstring
|
[1] See `help:signal-flow` docstring
|
||||||
[2] See `help:signal-content` docstring
|
[2] See `help:signal-content` docstring
|
||||||
[3] See `help:signal-options` docstring
|
[3] See `help:signal-options` docstring
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ For more info:
|
||||||
|
|
||||||
- On call filters, see: `help:filters` docstring
|
- On call filters, see: `help:filters` docstring
|
||||||
- On handler filters, see: `help:handlers` docstring
|
- On handler filters, see: `help:handlers` docstring
|
||||||
- On signal flow, see: Ref. <https://tinyurl.com/telemere-signal-flowchart>
|
- On signal flow, see: Ref. <https://www.taoensso.com/telemere/flowchart>
|
||||||
|
|
||||||
If anything is unclear, please ping me (@ptaoussanis) so that I can
|
If anything is unclear, please ping me (@ptaoussanis) so that I can
|
||||||
improve these docs!
|
improve these docs!
|
||||||
6
resources/signal-docstrings/signal-formatters.txt
Normal file
6
resources/signal-docstrings/signal-formatters.txt
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
Common signal formatters include:
|
||||||
|
(utils/format-signal-str->fn) {<opts>}) ; For human-readable string output (default)
|
||||||
|
(utils/format-signal->edn-fn) {<opts>}) ; For edn output
|
||||||
|
(utils/format-signal->json-fn {<opts>}) ; For JSON output
|
||||||
|
|
||||||
|
See relevant docstrings for details.
|
||||||
|
|
@ -21,7 +21,7 @@ Signal options (shared by `signal!`, `event!`, ...):
|
||||||
`:elidable?` - Should signal call be subject to compile-time elision? (Default: true)
|
`:elidable?` - Should signal call be subject to compile-time elision? (Default: true)
|
||||||
`:sample-rate` - ?rate ∈ℝ[0,1] for call sampling (0.75 => allow 75% of signals, nil => allow all)
|
`:sample-rate` - ?rate ∈ℝ[0,1] for call sampling (0.75 => allow 75% of signals, nil => allow all)
|
||||||
`:when` - Arb ?form; when present, form must return truthy to allow signal
|
`:when` - Arb ?form; when present, form must return truthy to allow signal
|
||||||
`:rate-limit` - ?spec as given to `telemere/rate-limiter`, see its docstring for details
|
`:rate-limit` - ?spec as given to `taoensso.telemere/rate-limiter`, see its docstring for details
|
||||||
`:middleware` - ?[(fn [signal])=>modified-signal ...] call middleware
|
`:middleware` - ?[(fn [signal])=>modified-signal ...] call middleware
|
||||||
`:trace?` - Should tracing be enabled for `:run` form?
|
`:trace?` - Should tracing be enabled for `:run` form?
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,6 @@ Tips:
|
||||||
(catch->error! ::error-id (spy! ...)).
|
(catch->error! ::error-id (spy! ...)).
|
||||||
|
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
[1] See `help:signal-handling` docstring
|
[1] See `help:signal-flow` docstring
|
||||||
[2] See `help:signal-content` docstring
|
[2] See `help:signal-content` docstring
|
||||||
[3] See `help:signal-options` docstring
|
[3] See `help:signal-options` docstring
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,6 @@ Tips:
|
||||||
common logging level of the same name.
|
common logging level of the same name.
|
||||||
|
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
[1] See `help:signal-handling` docstring
|
[1] See `help:signal-flow` docstring
|
||||||
[2] See `help:signal-content` docstring
|
[2] See `help:signal-content` docstring
|
||||||
[3] See `help:signal-options` docstring
|
[3] See `help:signal-options` docstring
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{;;:lein true
|
{;;:lein true
|
||||||
:source-paths ["src" "test"]
|
:source-paths ["src" "test"]
|
||||||
:dependencies
|
:dependencies
|
||||||
[[com.taoensso/encore "3.98.0-SNAPSHOT"]
|
[[com.taoensso/encore "3.100.0"]
|
||||||
[cider/cider-nrepl "0.47.0"]
|
[cider/cider-nrepl "0.47.0"]
|
||||||
[binaryage/devtools "1.0.7"]]
|
[binaryage/devtools "1.0.7"]]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
(remove-ns 'taoensso.telemere)
|
(remove-ns 'taoensso.telemere)
|
||||||
(:api (enc/interns-overview)))
|
(:api (enc/interns-overview)))
|
||||||
|
|
||||||
(enc/assert-min-encore-version [3 99 0])
|
(enc/assert-min-encore-version [3 100 0])
|
||||||
|
|
||||||
;;;; TODO
|
;;;; TODO
|
||||||
;; - Review, TODOs, missing docstrings
|
;; - Review, TODOs, missing docstrings
|
||||||
|
|
@ -48,8 +48,9 @@
|
||||||
(sigs/def-api
|
(sigs/def-api
|
||||||
{:purpose "signal"
|
{:purpose "signal"
|
||||||
:sf-arity 4
|
:sf-arity 4
|
||||||
:*sig-handlers* impl/*sig-handlers*
|
:ct-sig-filter impl/ct-sig-filter
|
||||||
:*rt-sig-filter* impl/*rt-sig-filter*})
|
:*rt-sig-filter* impl/*rt-sig-filter*
|
||||||
|
:*sig-handlers* impl/*sig-handlers*})
|
||||||
|
|
||||||
(comment
|
(comment
|
||||||
[level-aliases
|
[level-aliases
|
||||||
|
|
@ -81,9 +82,12 @@
|
||||||
|
|
||||||
(comment help:filters help:handlers) ; Via Encore
|
(comment help:filters help:handlers) ; Via Encore
|
||||||
|
|
||||||
(impl/defhelp help:signal-handling :signal-handling)
|
(impl/defhelp help:signal-options :signal-options)
|
||||||
(impl/defhelp help:signal-content :signal-content)
|
(impl/defhelp help:signal-content :signal-content)
|
||||||
(impl/defhelp help:signal-options :signal-options)
|
(impl/defhelp help:signal-flow :signal-flow)
|
||||||
|
(impl/defhelp help:signal-formatters :signal-formatters)
|
||||||
|
(enc/defalias help:signal-filters help:filters)
|
||||||
|
(enc/defalias help:signal-handlers help:handlers)
|
||||||
|
|
||||||
;;;; Context
|
;;;; Context
|
||||||
|
|
||||||
|
|
@ -374,15 +378,6 @@
|
||||||
|
|
||||||
;;;; Handlers
|
;;;; Handlers
|
||||||
|
|
||||||
(enc/def* help:signal-formatters
|
|
||||||
"Common signal formatters include:
|
|
||||||
(utils/format-signal-str->fn) {<opts>}) ; For human-readable string output (default)
|
|
||||||
(utils/format-signal->edn-fn) {<opts>}) ; For edn output
|
|
||||||
(utils/format-signal->json-fn {<opts>}) ; For JSON output
|
|
||||||
|
|
||||||
See relevant docstrings for details."
|
|
||||||
"See docstring")
|
|
||||||
|
|
||||||
(enc/defaliases
|
(enc/defaliases
|
||||||
#?(:default handlers:console/handler:console)
|
#?(:default handlers:console/handler:console)
|
||||||
#?(:cljs handlers:console/handler:console-raw)
|
#?(:cljs handlers:console/handler:console-raw)
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
|
|
||||||
(def ^String attr-name
|
(def ^String attr-name
|
||||||
"Returns cached OpenTelemetry-style name: `:foo/bar-baz` -> \"foo_bar_baz\", etc.
|
"Returns cached OpenTelemetry-style name: `:foo/bar-baz` -> \"foo_bar_baz\", etc.
|
||||||
Ref. <https://opentelemetry.io/docs/specs/semconv/general/attribute-naming/>"
|
Ref. <https://opentelemetry.io/docs/specs/semconv/general/attribute-naming/>."
|
||||||
(enc/fmemoize
|
(enc/fmemoize
|
||||||
(fn
|
(fn
|
||||||
([prefix x] (str (attr-name prefix) "." (attr-name x))) ; For `merge-prefix-map`, etc.
|
([prefix x] (str (attr-name prefix) "." (attr-name x))) ; For `merge-prefix-map`, etc.
|
||||||
|
|
@ -104,7 +104,7 @@
|
||||||
(comment (merge-prefix-map {} "data" {:a/b1 "v1" :a/b2 "v2" :nil nil}))
|
(comment (merge-prefix-map {} "data" {:a/b1 "v1" :a/b2 "v2" :nil nil}))
|
||||||
|
|
||||||
(defn signal->attrs-map
|
(defn signal->attrs-map
|
||||||
"Returns attributes map for given signal.
|
"Returns attributes map for given signal,
|
||||||
Ref. <https://opentelemetry.io/docs/specs/otel/logs/data-model/>."
|
Ref. <https://opentelemetry.io/docs/specs/otel/logs/data-model/>."
|
||||||
[extra-attrs-key signal]
|
[extra-attrs-key signal]
|
||||||
(let [attrs-map
|
(let [attrs-map
|
||||||
|
|
|
||||||
|
|
@ -534,8 +534,8 @@
|
||||||
{:macro-form &form
|
{:macro-form &form
|
||||||
:macro-env &env
|
:macro-env &env
|
||||||
:sf-arity 4
|
:sf-arity 4
|
||||||
:ct-sig-filter ct-sig-filter
|
:ct-sig-filter ct-sig-filter
|
||||||
:rt-sig-filter `*rt-sig-filter*}
|
:*rt-sig-filter* `*rt-sig-filter*}
|
||||||
opts)]
|
opts)]
|
||||||
|
|
||||||
(if elide?
|
(if elide?
|
||||||
|
|
@ -663,8 +663,8 @@
|
||||||
{:macro-form &form
|
{:macro-form &form
|
||||||
:macro-env &env
|
:macro-env &env
|
||||||
:sf-arity 4
|
:sf-arity 4
|
||||||
:ct-sig-filter ct-sig-filter
|
:ct-sig-filter ct-sig-filter
|
||||||
:rt-sig-filter `*rt-sig-filter*}
|
:*rt-sig-filter* `*rt-sig-filter*}
|
||||||
opts)]
|
opts)]
|
||||||
|
|
||||||
(and (not elide?) allow?))))
|
(and (not elide?) allow?))))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue