Liking cljdoc? Tell your friends :D

org.purefn.kurosawa.web.prometheus

Includes a prometheus ring middleware using iapetos and bidi. Bidi's route matching is required to remove route params from the time series.

This library does not include iapetos and bidi as dependencies directly, so requiring this namespace will break unless you've done so yourself.

Includes a prometheus ring middleware using iapetos and bidi.  Bidi's route
matching is required to remove route params from the time series.

This library does not include iapetos and bidi as dependencies directly, so
requiring this namespace will break unless you've done so yourself.
raw docstring

create-registryclj

(create-registry registration)

Creates PrometheusRegistry which stuartsierra.component knows how to start.

registration must be a list of 1-arity functions expecting and returning an IaopetosRegistry. Each fn will be called on startup to register Prometheus metrics.

Creates PrometheusRegistry which stuartsierra.component knows how to start.

`registration` must be a list of 1-arity functions expecting and returning an
`IaopetosRegistry`.  Each fn will be called on startup to register Prometheus metrics.
sourceraw docstring

initializeclj

(initialize registry
            &
            [{:keys [latency-histogram-buckets labels]
              :or {latency-histogram-buckets [0.001 0.005 0.01 0.02 0.05 0.1 0.2
                                              0.3 0.5 0.75 1 5]}}])

Initialize all collectors for Ring handler instrumentation. This includes:

  • http_request_latency_seconds
  • http_requests_total
  • http_exceptions_total

Additional :labels can be given which need to be supplied using a :label-fn in wrap-instrumentation or wrap-metrics.

Initialize all collectors for Ring handler instrumentation. This includes:

- `http_request_latency_seconds`
- `http_requests_total`
- `http_exceptions_total`

Additional `:labels` can be given which need to be supplied using a
`:label-fn` in [[wrap-instrumentation]] or [[wrap-metrics]].  
sourceraw docstring

metrics-responseclj

(metrics-response registry)

Create a Ring response map describing the given collector registry's contents using the text format (version 0.0.4).

Create a Ring response map describing the given collector registry's contents
using the text format (version 0.0.4).
sourceraw docstring

pathclj

(path routes ignore-keys {:keys [uri request-method]})
source

registryclj

source

wrap-instrumentationclj

(wrap-instrumentation handler
                      {:keys [path-fn label-fn]
                       :or {path-fn :uri label-fn (constantly {})}
                       :as options})

Like iapetos' wrap-instrumentation but fetches the Prometheus registry from the request map at request time, where iapetos captures the references in a closure.

For more detail see iapetos.collector.ring/wrap-instrumentation: https://github.com/clj-commons/iapetos/blob/0fecedaf8454e17e41b05e0e14754a311b9f4ce2/src/iapetos/collector/ring.clj#L143

Like iapetos' `wrap-instrumentation` but fetches the Prometheus registry from
the request map at request time, where iapetos captures the references in a closure.

For more detail see iapetos.collector.ring/wrap-instrumentation:
https://github.com/clj-commons/iapetos/blob/0fecedaf8454e17e41b05e0e14754a311b9f4ce2/src/iapetos/collector/ring.clj#L143
sourceraw docstring

wrap-metricsclj

(wrap-metrics handler routes registry)
(wrap-metrics handler routes registry {:keys [ignore-keys] :as options})

Wrap all ring requests with prometheus instrumentation and exposes metrics /metrics.

  • handler the ring handler fn
  • routes bidi web routes
  • registry an instance of IapetosRegistry
Wrap all ring requests with prometheus instrumentation and exposes metrics
`/metrics`.

- `handler` the ring handler fn
- `routes` bidi web routes
- `registry` an instance of IapetosRegistry
sourceraw docstring

wrap-metrics-exposeclj

(wrap-metrics-expose handler
                     &
                     [{:keys [path on-request]
                       :or {path "/metrics" on-request identity}}])

Expose Prometheus metrics at the given constant URI using the text format.

Expose Prometheus metrics at the given constant URI using the text format.
sourceraw docstring

wrap-stateful-metricsclj

(wrap-stateful-metrics handler routes {:keys [ignore-keys] :as options})

Wrap all ring requests with prometheus instrumentation and exposes metrics /metrics. Does not require a prometheus registry be passed in.

  • handler the ring handler fn
  • routes bidi web routes
Wrap all ring requests with prometheus instrumentation and exposes metrics
`/metrics`.  Does not require a prometheus registry be passed in.

- `handler` the ring handler fn
- `routes` bidi web routes
sourceraw docstring

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

× close