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.
(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.
(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]].
(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).
(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
(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 fnroutes
bidi web routesregistry
an instance of IapetosRegistryWrap 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-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.
(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 fnroutes
bidi web routesWrap 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
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close