-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | WAI middlware for exposing http://prometheus.io metrics.
--   
--   WAI middlware for exposing <a>http://prometheus.io</a> metrics.
@package wai-middleware-prometheus
@version 0.3.0


-- | This module provides <a>Network.Wai</a> middlware for exporting
--   <a>Prometheus</a> metrics and for instrumenting WAI applications.
module Network.Wai.Middleware.Prometheus

-- | Expose Prometheus metrics and instrument an application with some
--   basic metrics (e.g. request latency).
prometheus :: PrometheusSettings -> Middleware

-- | Settings that control the behavior of the Prometheus middleware.
data PrometheusSettings
PrometheusSettings :: [Text] -> Bool -> Bool -> PrometheusSettings

-- | The path that will be used for exporting metrics. The default value is
--   ["metrics"] which corresponds to the path /metrics.
[prometheusEndPoint] :: PrometheusSettings -> [Text]

-- | Whether the default instrumentation should be applied to the
--   application. If this is set to false the application can still be
--   instrumented using the <a>instrumentApp</a> function. The default
--   value is True.
[prometheusInstrumentApp] :: PrometheusSettings -> Bool

-- | Whether the default instrumentation should be applied to the
--   middleware that serves the metrics endpoint. The default value is
--   True.
[prometheusInstrumentPrometheus] :: PrometheusSettings -> Bool

-- | The default value for this type.
def :: Default a => a

-- | Instrument a WAI app with the default WAI metrics.
--   
--   If you use this function you will likely want to override the default
--   value of <a>prometheusInstrumentApp</a> to be false so that your app
--   does not get double instrumented.
instrumentApp :: String -> Application -> Application

-- | Instrument an IO action with timing metrics. This function can be used
--   if you would like to get more fine grained metrics, for instance this
--   can be used to instrument individual end points.
--   
--   If you use this function you will likely want to override the default
--   value of <a>prometheusInstrumentApp</a> to be false so that your app
--   does not get double instrumented.
instrumentIO :: String -> IO a -> IO a

-- | WAI Application that serves the Prometheus metrics page regardless of
--   what the request is.
metricsApp :: Application
instance Data.Default.Class.Default Network.Wai.Middleware.Prometheus.PrometheusSettings
