prometheus-wai-middleware-1.0.0.0: Instrument a wai application with various metrics

Safe HaskellNone
LanguageHaskell2010

Network.Wai.Middleware.Prometheus

Synopsis

Documentation

applicationMetrics :: MonadIO m => Labels -> RegistryT m ApplicationMetrics Source #

Set up the metrics for HTTP response codes and request handling durations. We identify the response code counters by http_requests_total with codes labeled by http_response_code. We identify the duration histogram by http_request_duration_milliseconds Use labels to identify your particular application.

countStatusCode :: ApplicationMetrics -> Int -> IO () Source #

Increment the count for a specific status code, by number

observeDuration :: ApplicationMetrics -> Double -> IO () Source #

Add a request duration observation in ms

instrumentApplication :: ApplicationMetrics -> Middleware Source #

This middleware adds response code tracking and request duration statistics for the application, aggregating across all requests