Pure ergonomics for tracing — the with-span macro. Depends only on the
tracing port; the side effects happen in the tracer the macro is handed.
Pure ergonomics for tracing — the `with-span` macro. Depends only on the tracing port; the side effects happen in the tracer the macro is handed.
(with-span tracer [span-sym name & [attributes]] & body)Run body inside a span, bound to span-sym. Delegates to the tracer's
with-span*, so the span is started, has any thrown exception recorded and
rethrown, and is always ended. Returns the value of body.
(with-span tracer [sp "handle-request" {:route "/x"}] (handle sp request))
The attributes map is optional:
(with-span tracer [sp "work"] (do-work))
Run `body` inside a span, bound to `span-sym`. Delegates to the tracer's
`with-span*`, so the span is started, has any thrown exception recorded and
rethrown, and is always ended. Returns the value of `body`.
(with-span tracer [sp "handle-request" {:route "/x"}]
(handle sp request))
The attributes map is optional:
(with-span tracer [sp "work"] (do-work))cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |