Liking cljdoc? Tell your friends :D

iapetos.collector.exceptions


exception-counterclj

(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.
sourceraw docstring

with-exceptionscljmacro

(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.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close