(exception-counter
metric
&
[{:keys [description labels]
:or {description "the number and class of encountered exceptions."}}])Create a new exception counter.
Note that the label exceptionClass will be automatically added.
Create a new exception counter. Note that the label `exceptionClass` will be automatically added.
(with-exceptions exception-counter & body)Use the given exception-counter to collect any Exceptions thrown within
the given piece of code.
(defonce registry
(-> (prometheus/collector-registry)
(prometheus/register
(exeception-counter :app/exceptions-total))))
(with-exceptions (registry :app/exceptions-total)
...)
The exception class will be stored in the counter's exceptionClass label.
Use the given [[exception-counter]] to collect any Exceptions thrown within
the given piece of code.
```
(defonce registry
(-> (prometheus/collector-registry)
(prometheus/register
(exeception-counter :app/exceptions-total))))
(with-exceptions (registry :app/exceptions-total)
...)
```
The exception class will be stored in the counter's `exceptionClass` label.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 |