Pedestal metrics are a wrapper around {otel}, which provides cross-platform solutions for metrics, tracing, and logging.
Metrics and tracing are provided in the io.pedestal/pedestal.telemetry library.
The api:*[] namespace contains the API that applications can use to emit metrics.
Pedestal supports:
A numeric value that increases over time, such as the number of requests processed.
Measures value that varies over time, such as the depth of a queue.
Measures a duration and a count, used for things like request processing time.
Tracks a range of values, exposing them in different bucket ranges; useful for identifying broad trends, and used for metrics such as size of incoming requests.
The metrics API is built around the api:*default-metric-source*[], which is created at startup from function identified by runtime configuration.
Open Telemetry defines a wide range of JVM system properties and environment variables to configure metrics (and tracing); those are outside the scope of this document.
Rather than rely on outside configuration, an application can provide its own initialization function to setup Open Telemetry as needed.
Pedestal has a small amount of built-in metrics.
A counter of the number of incoming requests, produced by the api:log-request[ns=io.pedestal.http/log-request] interceptor.
A counter for the number of requests that are allowed, produced by the api:allow-origin[ns=io.pedestal.http.cors] interceptor.
A counter for number of uncaught exceptions thrown during interceptor execution.
A gauge measuring the number of active requests in progress at any one time.
A histogram measuring the size of server-sent messages sent to the client.
A gauge of the number of active streams sending server-sent messages.
A counter of the number of times that the asynchrounous pipe to a client closed during delivery of a streaming response.
Where Pedestal emits metrics, it emits them both using the deprecated 0.6 metrics support, and the new pedestal.telemetry implementation.
In addition, there is support for the Drop Wizard metrics library as an alternative to Open Telemetry, via api:default-registry[ns=io.pedestal.metrics.codahale]; this is to provide a migration path from Pedestal 0.6 to Pedestal 0.7 when your application is making use of the deprecated metrics support.
In a future Pedestal release, the deprecated metrics support in the api:*[ns=io.pedestal.log] namespace will be removed entirely from Pedestal. |
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close