-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Prometheus Haskell Client
--
--
-- - Prometheus Haskell Client
--
--
-- A simple and modern, type safe, idiomatic Haskell client for
-- Prometheus monitoring. Specifically there is no use of unsafe
-- IO or manual ByteString construction from lists of bytes.
-- Batteries-included web server.
--
--
--
--
-- module Example where
--
-- import System.Metrics.Prometheus.GlobalRegistry
-- import System.Metrics.Prometheus.Http
-- import System.Metrics.Prometheus.Metric.Counter (inc)
-- import System.Metrics.Prometheus.MetricId
--
--
-- main :: IO ()
-- main = do
-- globalRegistry <- new
--
-- -- Labels can be defined as lists or added to an empty label set
-- connectSuccessGauge <- registerGauge "example_connections" (fromList [("login", "success")]) globalRegistry
-- connectFailureGauge <- registerGauge "example_connections" (addLabel "login" "failure" mempty) globalRegistry
-- connectCounter <- registerCounter "example_connection_total" mempty globalRegistry
-- latencyHistogram <- registerHistogram "example_round_trip_latency_ms" mempty [10, 20..100] globalRegistry
--
-- inc connectCounter -- increment a counter
--
-- -- [...] pass metric handles to the rest of the app
--
-- serveHttpTextMetrics 8080 globalRegistry -- http://localhost:8080/metric server
--
--
--
--
-- A Registry and StateT-based RegistryT are
-- available for unit testing or generating lists of `[IO a]` actions
-- that can be sequenced and returned from pure code to be
-- applied.
@package prometheus
@version 0.2.0
module System.Metrics.Prometheus.Metric.Summary
data SummarySample
SummarySample :: Map Double Int -> Int -> Int -> SummarySample
[sumQuantiles] :: SummarySample -> Map Double Int
[sumSum] :: SummarySample -> Int
[sumCount] :: SummarySample -> Int
module System.Metrics.Prometheus.Metric.Histogram
data Histogram
data HistogramSample
HistogramSample :: Buckets -> Double -> Int -> HistogramSample
[histBuckets] :: HistogramSample -> Buckets
[histSum] :: HistogramSample -> Double
[histCount] :: HistogramSample -> Int
type Buckets = Map UpperBound Double
type UpperBound = Double
new :: [UpperBound] -> IO Histogram
observe :: Double -> Histogram -> IO ()
sample :: Histogram -> IO HistogramSample
module System.Metrics.Prometheus.MetricId
newtype Name
Name :: Text -> Name
[unName] :: Name -> Text
newtype Labels
Labels :: Map Text Text -> Labels
[unLabels] :: Labels -> Map Text Text
data MetricId
MetricId :: Name -> Labels -> MetricId
[name] :: MetricId -> Name
[labels] :: MetricId -> Labels
addLabel :: Text -> Text -> Labels -> Labels
fromList :: [(Text, Text)] -> Labels
toList :: Labels -> [(Text, Text)]
null :: Labels -> Bool
instance GHC.Show.Show System.Metrics.Prometheus.MetricId.MetricId
instance GHC.Classes.Ord System.Metrics.Prometheus.MetricId.MetricId
instance GHC.Classes.Eq System.Metrics.Prometheus.MetricId.MetricId
instance GHC.Base.Monoid System.Metrics.Prometheus.MetricId.Labels
instance GHC.Classes.Ord System.Metrics.Prometheus.MetricId.Labels
instance GHC.Classes.Eq System.Metrics.Prometheus.MetricId.Labels
instance GHC.Show.Show System.Metrics.Prometheus.MetricId.Labels
instance GHC.Base.Monoid System.Metrics.Prometheus.MetricId.Name
instance Data.String.IsString System.Metrics.Prometheus.MetricId.Name
instance GHC.Classes.Ord System.Metrics.Prometheus.MetricId.Name
instance GHC.Classes.Eq System.Metrics.Prometheus.MetricId.Name
instance GHC.Show.Show System.Metrics.Prometheus.MetricId.Name
module System.Metrics.Prometheus.Metric.Gauge
data Gauge
newtype GaugeSample
GaugeSample :: Double -> GaugeSample
[unGaugeSample] :: GaugeSample -> Double
new :: IO Gauge
add :: Double -> Gauge -> IO ()
sub :: Double -> Gauge -> IO ()
inc :: Gauge -> IO ()
dec :: Gauge -> IO ()
set :: Double -> Gauge -> IO ()
sample :: Gauge -> IO GaugeSample
module System.Metrics.Prometheus.Metric.Counter
data Counter
newtype CounterSample
CounterSample :: Int -> CounterSample
[unCounterSample] :: CounterSample -> Int
new :: IO Counter
add :: Int -> Counter -> IO ()
inc :: Counter -> IO ()
sample :: Counter -> IO CounterSample
module System.Metrics.Prometheus.Metric
data Metric
CounterMetric :: Counter -> Metric
GaugeMetric :: Gauge -> Metric
-- | Summary S.Summary
HistogramMetric :: Histogram -> Metric
data MetricSample
CounterMetricSample :: CounterSample -> MetricSample
GaugeMetricSample :: GaugeSample -> MetricSample
HistogramMetricSample :: HistogramSample -> MetricSample
SummaryMetricSample :: SummarySample -> MetricSample
metricSample :: (CounterSample -> a) -> (GaugeSample -> a) -> (HistogramSample -> a) -> (SummarySample -> a) -> MetricSample -> a
module System.Metrics.Prometheus.Registry
data Registry
newtype RegistrySample
RegistrySample :: Map MetricId MetricSample -> RegistrySample
[unRegistrySample] :: RegistrySample -> Map MetricId MetricSample
new :: Registry
registerCounter :: Name -> Labels -> Registry -> IO (Counter, Registry)
registerGauge :: Name -> Labels -> Registry -> IO (Gauge, Registry)
registerHistogram :: Name -> Labels -> [UpperBound] -> Registry -> IO (Histogram, Registry)
sample :: Registry -> IO RegistrySample
instance GHC.Show.Show System.Metrics.Prometheus.Registry.KeyError
instance GHC.Exception.Exception System.Metrics.Prometheus.Registry.KeyError
module System.Metrics.Prometheus.GlobalRegistry
data GlobalRegistry
new :: IO GlobalRegistry
registerCounter :: Name -> Labels -> GlobalRegistry -> IO Counter
registerGauge :: Name -> Labels -> GlobalRegistry -> IO Gauge
registerHistogram :: Name -> Labels -> [UpperBound] -> GlobalRegistry -> IO Histogram
sample :: GlobalRegistry -> IO RegistrySample
module System.Metrics.Prometheus.RegistryT
newtype RegistryT m a
RegistryT :: StateT Registry m a -> RegistryT m a
[unRegistryT] :: RegistryT m a -> StateT Registry m a
evalRegistryT :: Monad m => RegistryT m a -> m a
execRegistryT :: Monad m => RegistryT m a -> m Registry
runRegistryT :: Monad m => RegistryT m a -> m (a, Registry)
withRegistry :: (Registry -> m (a, Registry)) -> RegistryT m a
registerCounter :: Name -> Labels -> RegistryT IO Counter
registerGauge :: Name -> Labels -> RegistryT IO Gauge
registerHistogram :: Name -> Labels -> [UpperBound] -> RegistryT IO Histogram
sample :: RegistryT IO RegistrySample
instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (System.Metrics.Prometheus.RegistryT.RegistryT m)
instance GHC.Base.Monad m => Control.Monad.State.Class.MonadState System.Metrics.Prometheus.Registry.Registry (System.Metrics.Prometheus.RegistryT.RegistryT m)
instance GHC.Base.Functor m => GHC.Base.Functor (System.Metrics.Prometheus.RegistryT.RegistryT m)
instance GHC.Base.Monad m => GHC.Base.Applicative (System.Metrics.Prometheus.RegistryT.RegistryT m)
instance Control.Monad.Trans.Class.MonadTrans System.Metrics.Prometheus.RegistryT.RegistryT
instance GHC.Base.Monad m => GHC.Base.Monad (System.Metrics.Prometheus.RegistryT.RegistryT m)
module System.Metrics.Prometheus.Encode.MetricId
encodeHeader :: MetricId -> MetricSample -> Builder
encodeMetricId :: MetricId -> Builder
encodeLabels :: Labels -> Builder
encodeName :: Name -> Builder
textValue :: RealFloat f => f -> Text
encodeDouble :: RealFloat f => f -> Builder
encodeInt :: Int -> Builder
escape :: Text -> Text
newline :: Builder
space :: Builder
module System.Metrics.Prometheus.Encode.Histogram
encodeHistogram :: MetricId -> HistogramSample -> Builder
module System.Metrics.Prometheus.Encode
encodeMetrics :: RegistrySample -> Builder
serializeMetrics :: RegistrySample -> ByteString
module System.Metrics.Prometheus.Http
type Path = [Text]
serveHttpTextMetricsDef :: Port -> GlobalRegistry -> IO ()
serveHttpTextMetrics :: Path -> Port -> GlobalRegistry -> IO ()
prometheusApp :: Path -> GlobalRegistry -> Application
prometheusResponse :: (Response -> IO b) -> GlobalRegistry -> IO b