Liking cljdoc? Tell your friends :D

daaku.metrics

Clojure API over the Prometheus Java SDK.

This API doesn't try to keep you far away from the Java API. You will likely end up using that API directly. The functions here provide idiomatic (and performant) access to the Collectors.

All Collector creation functions take the same set of options. :name and :help are required, :namespace, :subsystem & :labels are optional.

The expected usage pattern is to create a long lived Collector instance, and use the functions in this package to track the metrics. Most commonly, you will create a package level private var to keep a reference to a metric.

(require '[daaku.metrics :as m])

(def ^:private m-emails-sent (m/counter {:name :emails-sent
                                         :help "emails we sent"}))

(defn- send-email []
  (println "sending email")
  (m/inc m-emails-sent))
Clojure API over the Prometheus Java SDK.

This API doesn't try to keep you far away from the Java API. You
will likely end up using that API directly. The functions here
provide idiomatic (and performant) access to the Collectors.

All Collector creation functions take the same set of
options. `:name` and `:help` are required, `:namespace`,
`:subsystem` & `:labels` are optional.

The expected usage pattern is to create a long lived Collector
instance, and use the functions in this package to track the
metrics. Most commonly, you will create a package level private var
to keep a reference to a metric.

```clojure
(require '[daaku.metrics :as m])

(def ^:private m-emails-sent (m/counter {:name :emails-sent
                                         :help "emails we sent"}))

(defn- send-email []
  (println "sending email")
  (m/inc m-emails-sent))
```
raw docstring

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

× close