hermod-tracing-core
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hermod.Tracing

Description

Batteries-included public interface for the Hermod tracing system.

A typical application wires up tracing in three steps:

  1. Define trace types: for each domain-specific message type, write LogFormatting (human/machine rendering, metrics) and MetaTrace (namespace, severity, documentation) instances.
  2. Construct backends: call mkHermodTracer (or mkHermodTracer') with standardTracer, ekgTracer, and/or forwardTracer to build a 'Trace IO YourType'.
  3. Configure: load a TraceConfig with readConfiguration and apply it with configureTracers. Use checkTraceConfiguration to validate the config against all known namespaces at startup.
Synopsis

Documentation

class Contravariant (f :: Type -> Type) where Source #

The class of contravariant functors.

Whereas in Haskell, one can think of a Functor as containing or producing values, a contravariant functor is a functor that can be thought of as consuming values.

As an example, consider the type of predicate functions a -> Bool. One such predicate might be negative x = x < 0, which classifies integers as to whether they are negative. However, given this predicate, we can re-use it in other situations, providing we have a way to map values to integers. For instance, we can use the negative predicate on a person's bank balance to work out if they are currently overdrawn:

newtype Predicate a = Predicate { getPredicate :: a -> Bool }

instance Contravariant Predicate where
  contramap :: (a' -> a) -> (Predicate a -> Predicate a')
  contramap f (Predicate p) = Predicate (p . f)
                                         |   `- First, map the input...
                                         `----- then apply the predicate.

overdrawn :: Predicate Person
overdrawn = contramap personBankBalance negative

Any instance should be subject to the following laws:

Identity
contramap id = id
Composition
contramap (g . f) = contramap f . contramap g

Note, that the second law follows from the free theorem of the type of contramap and the first law, so you need only check that the former condition holds.

Minimal complete definition

contramap

Methods

contramap :: (a' -> a) -> f a -> f a' Source #

(>$) :: b -> f b -> f a infixl 4 Source #

Replace all locations in the output with the same value. The default definition is contramap . const, but this may be overridden with a more efficient version.

Instances

Instances details
Contravariant ToJSONKeyFunction 
Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

contramap :: (a' -> a) -> ToJSONKeyFunction a -> ToJSONKeyFunction a' Source #

(>$) :: b -> ToJSONKeyFunction b -> ToJSONKeyFunction a Source #

Contravariant Comparison

A Comparison is a Contravariant Functor, because contramap can apply its function argument to each input of the comparison function.

Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> Comparison a -> Comparison a' Source #

(>$) :: b -> Comparison b -> Comparison a Source #

Contravariant Equivalence

Equivalence relations are Contravariant, because you can apply the contramapped function to each input to the equivalence relation.

Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> Equivalence a -> Equivalence a' Source #

(>$) :: b -> Equivalence b -> Equivalence a Source #

Contravariant Predicate

A Predicate is a Contravariant Functor, because contramap can apply its function argument to the input of the predicate.

Without newtypes contramap f equals precomposing with f (= (. f)).

contramap :: (a' -> a) -> (Predicate a -> Predicate a')
contramap f (Predicate g) = Predicate (g . f)
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> Predicate a -> Predicate a' Source #

(>$) :: b -> Predicate b -> Predicate a Source #

Contravariant (Op a) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a0) -> Op a a0 -> Op a a' Source #

(>$) :: b -> Op a b -> Op a a0 Source #

Contravariant (Proxy :: Type -> Type) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> Proxy a -> Proxy a' Source #

(>$) :: b -> Proxy b -> Proxy a Source #

Contravariant (U1 :: Type -> Type) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> U1 a -> U1 a' Source #

(>$) :: b -> U1 b -> U1 a Source #

Contravariant (V1 :: Type -> Type) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> V1 a -> V1 a' Source #

(>$) :: b -> V1 b -> V1 a Source #

Monad m => Contravariant (Tracer m) 
Instance details

Defined in Control.Tracer

Methods

contramap :: (a' -> a) -> Tracer m a -> Tracer m a' Source #

(>$) :: b -> Tracer m b -> Tracer m a Source #

Monad m => Contravariant (Trace m) 
Instance details

Defined in Hermod.Tracing.Types

Methods

contramap :: (a' -> a) -> Trace m a -> Trace m a' Source #

(>$) :: b -> Trace m b -> Trace m a Source #

Contravariant m => Contravariant (MaybeT m) 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

contramap :: (a' -> a) -> MaybeT m a -> MaybeT m a' Source #

(>$) :: b -> MaybeT m b -> MaybeT m a Source #

Contravariant (Const a :: Type -> Type) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a0) -> Const a a0 -> Const a a' Source #

(>$) :: b -> Const a b -> Const a a0 Source #

Contravariant f => Contravariant (Alt f) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> Alt f a -> Alt f a' Source #

(>$) :: b -> Alt f b -> Alt f a Source #

Contravariant f => Contravariant (Rec1 f) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> Rec1 f a -> Rec1 f a' Source #

(>$) :: b -> Rec1 f b -> Rec1 f a Source #

Contravariant f => Contravariant (Backwards f)

Derived instance.

Instance details

Defined in Control.Applicative.Backwards

Methods

contramap :: (a' -> a) -> Backwards f a -> Backwards f a' Source #

(>$) :: b -> Backwards f b -> Backwards f a Source #

Contravariant m => Contravariant (ExceptT e m) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

contramap :: (a' -> a) -> ExceptT e m a -> ExceptT e m a' Source #

(>$) :: b -> ExceptT e m b -> ExceptT e m a Source #

Contravariant f => Contravariant (IdentityT f) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

contramap :: (a' -> a) -> IdentityT f a -> IdentityT f a' Source #

(>$) :: b -> IdentityT f b -> IdentityT f a Source #

Contravariant m => Contravariant (ReaderT r m) 
Instance details

Defined in Control.Monad.Trans.Reader

Methods

contramap :: (a' -> a) -> ReaderT r m a -> ReaderT r m a' Source #

(>$) :: b -> ReaderT r m b -> ReaderT r m a Source #

Contravariant m => Contravariant (StateT s m) 
Instance details

Defined in Control.Monad.Trans.State.Lazy

Methods

contramap :: (a' -> a) -> StateT s m a -> StateT s m a' Source #

(>$) :: b -> StateT s m b -> StateT s m a Source #

Contravariant m => Contravariant (StateT s m) 
Instance details

Defined in Control.Monad.Trans.State.Strict

Methods

contramap :: (a' -> a) -> StateT s m a -> StateT s m a' Source #

(>$) :: b -> StateT s m b -> StateT s m a Source #

Contravariant m => Contravariant (WriterT w m) 
Instance details

Defined in Control.Monad.Trans.Writer.Lazy

Methods

contramap :: (a' -> a) -> WriterT w m a -> WriterT w m a' Source #

(>$) :: b -> WriterT w m b -> WriterT w m a Source #

Contravariant m => Contravariant (WriterT w m) 
Instance details

Defined in Control.Monad.Trans.Writer.Strict

Methods

contramap :: (a' -> a) -> WriterT w m a -> WriterT w m a' Source #

(>$) :: b -> WriterT w m b -> WriterT w m a Source #

Contravariant (Constant a :: Type -> Type) 
Instance details

Defined in Data.Functor.Constant

Methods

contramap :: (a' -> a0) -> Constant a a0 -> Constant a a' Source #

(>$) :: b -> Constant a b -> Constant a a0 Source #

Contravariant f => Contravariant (Reverse f)

Derived instance.

Instance details

Defined in Data.Functor.Reverse

Methods

contramap :: (a' -> a) -> Reverse f a -> Reverse f a' Source #

(>$) :: b -> Reverse f b -> Reverse f a Source #

(Contravariant f, Contravariant g) => Contravariant (Product f g) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> Product f g a -> Product f g a' Source #

(>$) :: b -> Product f g b -> Product f g a Source #

(Contravariant f, Contravariant g) => Contravariant (Sum f g) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> Sum f g a -> Sum f g a' Source #

(>$) :: b -> Sum f g b -> Sum f g a Source #

(Contravariant f, Contravariant g) => Contravariant (f :*: g) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> (f :*: g) a -> (f :*: g) a' Source #

(>$) :: b -> (f :*: g) b -> (f :*: g) a Source #

(Contravariant f, Contravariant g) => Contravariant (f :+: g) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> (f :+: g) a -> (f :+: g) a' Source #

(>$) :: b -> (f :+: g) b -> (f :+: g) a Source #

Contravariant (K1 i c :: Type -> Type) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> K1 i c a -> K1 i c a' Source #

(>$) :: b -> K1 i c b -> K1 i c a Source #

(Functor f, Contravariant g) => Contravariant (Compose f g) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> Compose f g a -> Compose f g a' Source #

(>$) :: b -> Compose f g b -> Compose f g a Source #

(Functor f, Contravariant g) => Contravariant (f :.: g) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> (f :.: g) a -> (f :.: g) a' Source #

(>$) :: b -> (f :.: g) b -> (f :.: g) a Source #

Contravariant f => Contravariant (M1 i c f) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a' -> a) -> M1 i c f a -> M1 i c f a' Source #

(>$) :: b -> M1 i c f b -> M1 i c f a Source #

Contravariant m => Contravariant (RWST r w s m) 
Instance details

Defined in Control.Monad.Trans.RWS.Lazy

Methods

contramap :: (a' -> a) -> RWST r w s m a -> RWST r w s m a' Source #

(>$) :: b -> RWST r w s m b -> RWST r w s m a Source #

Contravariant m => Contravariant (RWST r w s m) 
Instance details

Defined in Control.Monad.Trans.RWS.Strict

Methods

contramap :: (a' -> a) -> RWST r w s m a -> RWST r w s m a' Source #

(>$) :: b -> RWST r w s m b -> RWST r w s m a Source #

newtype Trace (m :: Type -> Type) a #

Constructors

Trace 

Instances

Instances details
Monad m => Contravariant (Trace m) 
Instance details

Defined in Hermod.Tracing.Types

Methods

contramap :: (a' -> a) -> Trace m a -> Trace m a' Source #

(>$) :: b -> Trace m b -> Trace m a Source #

Monad m => Monoid (Trace m a) 
Instance details

Defined in Hermod.Tracing.Types

Methods

mempty :: Trace m a Source #

mappend :: Trace m a -> Trace m a -> Trace m a Source #

mconcat :: [Trace m a] -> Trace m a Source #

Monad m => Semigroup (Trace m a) 
Instance details

Defined in Hermod.Tracing.Types

Methods

(<>) :: Trace m a -> Trace m a -> Trace m a Source #

sconcat :: NonEmpty (Trace m a) -> Trace m a Source #

stimes :: Integral b => b -> Trace m a -> Trace m a Source #

data DataPoint where Source #

Type wrapper for some value of type v. The only reason we need this wrapper is an ability to store different values in the same DataPointStore.

Please note that when the acceptor application will read the value of type v from the store, this value is just as unstructured JSON, but not Haskell value of type v. That's why FromJSON instance for type v should be available for the acceptor application, to decode unstructured JSON.

Constructors

DataPoint :: (ToJSON v, NFData v) => !v -> DataPoint 

data ConfigSource Source #

The configuration source that should be ingested

type NSWarnings = [Text] Source #

Warnings as a list of text

data TraceObject Source #

Used as interface object for ForwarderTracer

Instances

Instances details
Generic TraceObject Source # 
Instance details

Defined in Hermod.Tracing.Formatter

Associated Types

type Rep TraceObject :: Type -> Type Source #

Show TraceObject Source # 
Instance details

Defined in Hermod.Tracing.Formatter

NFData TraceObject Source # 
Instance details

Defined in Hermod.Tracing.Formatter

Methods

rnf :: TraceObject -> () Source #

Eq TraceObject Source # 
Instance details

Defined in Hermod.Tracing.Formatter

Serialise TraceObject Source # 
Instance details

Defined in Hermod.Tracing.Formatter

Methods

encode :: TraceObject -> Encoding

decode :: Decoder s TraceObject

encodeList :: [TraceObject] -> Encoding

decodeList :: Decoder s [TraceObject]

type Rep TraceObject Source #

Instances for TraceObject to forward it using 'trace-forward' library.

Instance details

Defined in Hermod.Tracing.Formatter

data LimiterSpec Source #

Constructors

LimiterSpec 

Fields

data HowToConnect Source #

Constructors

LocalPipe !FilePath

Local pipe (UNIX or Windows).

RemoteSocket !Host !Port

Remote socket (host and port).

Instances

Instances details
FromJSON HowToConnect Source # 
Instance details

Defined in Hermod.Tracing.Tracer.Forward

Methods

parseJSON :: Value -> Parser HowToConnect

parseJSONList :: Value -> Parser [HowToConnect]

omittedField :: Maybe HowToConnect

ToJSON HowToConnect Source # 
Instance details

Defined in Hermod.Tracing.Tracer.Forward

Methods

toJSON :: HowToConnect -> Value

toEncoding :: HowToConnect -> Encoding

toJSONList :: [HowToConnect] -> Value

toEncodingList :: [HowToConnect] -> Encoding

omitField :: HowToConnect -> Bool

Generic HowToConnect Source # 
Instance details

Defined in Hermod.Tracing.Tracer.Forward

Associated Types

type Rep HowToConnect :: Type -> Type Source #

Show HowToConnect Source # 
Instance details

Defined in Hermod.Tracing.Tracer.Forward

NFData HowToConnect Source # 
Instance details

Defined in Hermod.Tracing.Tracer.Forward

Methods

rnf :: HowToConnect -> () Source #

Eq HowToConnect Source # 
Instance details

Defined in Hermod.Tracing.Tracer.Forward

type Rep HowToConnect Source # 
Instance details

Defined in Hermod.Tracing.Tracer.Forward

type Rep HowToConnect = D1 ('MetaData "HowToConnect" "Hermod.Tracing.Tracer.Forward" "hermod-tracing-core-1.0.0-3AGmFuCq3qp5M1u5yyD0b6" 'False) (C1 ('MetaCons "LocalPipe" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FilePath)) :+: C1 ('MetaCons "RemoteSocket" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Host) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Port)))

type Host = Text Source #

Specifies how to connect to the peer.

Taken from ekg-forward:System.Metrics.Configuration, to avoid dependency.

data SeverityS #

Instances

Instances details
FromJSON SeverityS 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Methods

parseJSON :: Value -> Parser SeverityS

parseJSONList :: Value -> Parser [SeverityS]

omittedField :: Maybe SeverityS

ToJSON SeverityS 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Methods

toJSON :: SeverityS -> Value

toEncoding :: SeverityS -> Encoding

toJSONList :: [SeverityS] -> Value

toEncodingList :: [SeverityS] -> Encoding

omitField :: SeverityS -> Bool

Bounded SeverityS 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Enum SeverityS 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Generic SeverityS 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Associated Types

type Rep SeverityS :: Type -> Type Source #

Read SeverityS 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Show SeverityS 
Instance details

Defined in Hermod.Tracing.Types.Annotations

NFData SeverityS 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Methods

rnf :: SeverityS -> () Source #

Eq SeverityS 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Ord SeverityS 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Serialise SeverityS 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Methods

encode :: SeverityS -> Encoding

decode :: Decoder s SeverityS

encodeList :: [SeverityS] -> Encoding

decodeList :: Decoder s [SeverityS]

type Rep SeverityS 
Instance details

Defined in Hermod.Tracing.Types.Annotations

type Rep SeverityS = D1 ('MetaData "SeverityS" "Hermod.Tracing.Types.Annotations" "hermod-tracing-api-1.0.0-LO80W9OfQJv10WJ5Ly2Uoc-internal" 'False) (((C1 ('MetaCons "Debug" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Info" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Notice" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Warning" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Error" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Critical" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Alert" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Emergency" 'PrefixI 'False) (U1 :: Type -> Type))))

data Namespace a #

Constructors

Namespace 

Fields

Instances

Instances details
Show (Namespace a) 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Eq (Namespace a) 
Instance details

Defined in Hermod.Tracing.Types.Annotations

data TraceOptionForwarder #

Instances

Instances details
FromJSON TraceOptionForwarder 
Instance details

Defined in Hermod.Tracing.Types.Config

ToJSON TraceOptionForwarder 
Instance details

Defined in Hermod.Tracing.Types.Config

Generic TraceOptionForwarder 
Instance details

Defined in Hermod.Tracing.Types.Config

Associated Types

type Rep TraceOptionForwarder :: Type -> Type Source #

Show TraceOptionForwarder 
Instance details

Defined in Hermod.Tracing.Types.Config

Eq TraceOptionForwarder 
Instance details

Defined in Hermod.Tracing.Types.Config

Ord TraceOptionForwarder 
Instance details

Defined in Hermod.Tracing.Types.Config

type Rep TraceOptionForwarder 
Instance details

Defined in Hermod.Tracing.Types.Config

type Rep TraceOptionForwarder = D1 ('MetaData "TraceOptionForwarder" "Hermod.Tracing.Types.Config" "hermod-tracing-api-1.0.0-LO80W9OfQJv10WJ5Ly2Uoc-internal" 'False) (C1 ('MetaCons "TraceOptionForwarder" 'PrefixI 'True) (S1 ('MetaSel ('Just "tofQueueSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word) :*: (S1 ('MetaSel ('Just "tofVerbosity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Verbosity) :*: S1 ('MetaSel ('Just "tofMaxReconnectDelay") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word))))

data PrometheusSimpleRun #

Instances

Instances details
FromJSON PrometheusSimpleRun 
Instance details

Defined in Hermod.Tracing.Types.Config

ToJSON PrometheusSimpleRun 
Instance details

Defined in Hermod.Tracing.Types.Config

Generic PrometheusSimpleRun 
Instance details

Defined in Hermod.Tracing.Types.Config

Associated Types

type Rep PrometheusSimpleRun :: Type -> Type Source #

Show PrometheusSimpleRun 
Instance details

Defined in Hermod.Tracing.Types.Config

type Rep PrometheusSimpleRun 
Instance details

Defined in Hermod.Tracing.Types.Config

type Rep PrometheusSimpleRun = D1 ('MetaData "PrometheusSimpleRun" "Hermod.Tracing.Types.Config" "hermod-tracing-api-1.0.0-LO80W9OfQJv10WJ5Ly2Uoc-internal" 'False) (C1 ('MetaCons "PrometheusSimpleRun" 'PrefixI 'True) ((S1 ('MetaSel ('Just "connTimeout") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Word)) :*: S1 ('MetaSel ('Just "connCountGlobal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Word))) :*: (S1 ('MetaSel ('Just "connCountPerHost") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Word)) :*: S1 ('MetaSel ('Just "connPerSecond") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Double)))))

newtype SeverityF #

Constructors

SeverityF (Maybe SeverityS) 

Instances

Instances details
FromJSON SeverityF 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Methods

parseJSON :: Value -> Parser SeverityF

parseJSONList :: Value -> Parser [SeverityF]

omittedField :: Maybe SeverityF

ToJSON SeverityF 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Methods

toJSON :: SeverityF -> Value

toEncoding :: SeverityF -> Encoding

toJSONList :: [SeverityF] -> Value

toEncodingList :: [SeverityF] -> Encoding

omitField :: SeverityF -> Bool

Enum SeverityF 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Show SeverityF 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Eq SeverityF 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Ord SeverityF 
Instance details

Defined in Hermod.Tracing.Types.Annotations

data DetailLevel #

Instances

Instances details
FromJSON DetailLevel 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Methods

parseJSON :: Value -> Parser DetailLevel

parseJSONList :: Value -> Parser [DetailLevel]

omittedField :: Maybe DetailLevel

ToJSON DetailLevel 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Methods

toJSON :: DetailLevel -> Value

toEncoding :: DetailLevel -> Encoding

toJSONList :: [DetailLevel] -> Value

toEncodingList :: [DetailLevel] -> Encoding

omitField :: DetailLevel -> Bool

Bounded DetailLevel 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Enum DetailLevel 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Generic DetailLevel 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Associated Types

type Rep DetailLevel :: Type -> Type Source #

Show DetailLevel 
Instance details

Defined in Hermod.Tracing.Types.Annotations

NFData DetailLevel 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Methods

rnf :: DetailLevel -> () Source #

Eq DetailLevel 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Ord DetailLevel 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Serialise DetailLevel 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Methods

encode :: DetailLevel -> Encoding

decode :: Decoder s DetailLevel

encodeList :: [DetailLevel] -> Encoding

decodeList :: Decoder s [DetailLevel]

type Rep DetailLevel 
Instance details

Defined in Hermod.Tracing.Types.Annotations

type Rep DetailLevel = D1 ('MetaData "DetailLevel" "Hermod.Tracing.Types.Annotations" "hermod-tracing-api-1.0.0-LO80W9OfQJv10WJ5Ly2Uoc-internal" 'False) ((C1 ('MetaCons "DMinimal" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DNormal" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "DDetailed" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DMaximum" 'PrefixI 'False) (U1 :: Type -> Type)))

data BackendConfig #

Instances

Instances details
FromJSON BackendConfig 
Instance details

Defined in Hermod.Tracing.Types.Config

Methods

parseJSON :: Value -> Parser BackendConfig

parseJSONList :: Value -> Parser [BackendConfig]

omittedField :: Maybe BackendConfig

ToJSON BackendConfig 
Instance details

Defined in Hermod.Tracing.Types.Config

Generic BackendConfig 
Instance details

Defined in Hermod.Tracing.Types.Config

Associated Types

type Rep BackendConfig :: Type -> Type Source #

Show BackendConfig 
Instance details

Defined in Hermod.Tracing.Types.Config

Eq BackendConfig 
Instance details

Defined in Hermod.Tracing.Types.Config

Ord BackendConfig 
Instance details

Defined in Hermod.Tracing.Types.Config

type Rep BackendConfig 
Instance details

Defined in Hermod.Tracing.Types.Config

type Rep BackendConfig = D1 ('MetaData "BackendConfig" "Hermod.Tracing.Types.Config" "hermod-tracing-api-1.0.0-LO80W9OfQJv10WJ5Ly2Uoc-internal" 'False) ((C1 ('MetaCons "Forwarder" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Stdout" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FormatLogging))) :+: (C1 ('MetaCons "EKGBackend" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "DatapointBackend" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PrometheusSimple" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe HostName)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PortNumber))))))

data ConfigOption #

Instances

Instances details
Generic ConfigOption 
Instance details

Defined in Hermod.Tracing.Types.Config

Associated Types

type Rep ConfigOption :: Type -> Type Source #

Show ConfigOption 
Instance details

Defined in Hermod.Tracing.Types.Config

Eq ConfigOption 
Instance details

Defined in Hermod.Tracing.Types.Config

Ord ConfigOption 
Instance details

Defined in Hermod.Tracing.Types.Config

type Rep ConfigOption 
Instance details

Defined in Hermod.Tracing.Types.Config

type Rep ConfigOption = D1 ('MetaData "ConfigOption" "Hermod.Tracing.Types.Config" "hermod-tracing-api-1.0.0-LO80W9OfQJv10WJ5Ly2Uoc-internal" 'False) ((C1 ('MetaCons "ConfSeverity" 'PrefixI 'True) (S1 ('MetaSel ('Just "severity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SeverityF)) :+: C1 ('MetaCons "ConfDetail" 'PrefixI 'True) (S1 ('MetaSel ('Just "detail") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DetailLevel))) :+: (C1 ('MetaCons "ConfBackend" 'PrefixI 'True) (S1 ('MetaSel ('Just "backends") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [BackendConfig])) :+: C1 ('MetaCons "ConfLimiter" 'PrefixI 'True) (S1 ('MetaSel ('Just "maxFrequency") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double))))

data CounterAction #

Instances

Instances details
Generic CounterAction 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Associated Types

type Rep CounterAction :: Type -> Type Source #

Show CounterAction 
Instance details

Defined in Hermod.Tracing.Types.Annotations

NFData CounterAction 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Methods

rnf :: CounterAction -> () Source #

Eq CounterAction 
Instance details

Defined in Hermod.Tracing.Types.Annotations

type Rep CounterAction 
Instance details

Defined in Hermod.Tracing.Types.Annotations

type Rep CounterAction = D1 ('MetaData "CounterAction" "Hermod.Tracing.Types.Annotations" "hermod-tracing-api-1.0.0-LO80W9OfQJv10WJ5Ly2Uoc-internal" 'False) (C1 ('MetaCons "CounterIncrement" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CounterAdd" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))

data LoggingContext #

Instances

Instances details
Generic LoggingContext 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Associated Types

type Rep LoggingContext :: Type -> Type Source #

Show LoggingContext 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Serialise LoggingContext 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Methods

encode :: LoggingContext -> Encoding

decode :: Decoder s LoggingContext

encodeList :: [LoggingContext] -> Encoding

decodeList :: Decoder s [LoggingContext]

type Rep LoggingContext 
Instance details

Defined in Hermod.Tracing.Types.Annotations

type Rep LoggingContext = D1 ('MetaData "LoggingContext" "Hermod.Tracing.Types.Annotations" "hermod-tracing-api-1.0.0-LO80W9OfQJv10WJ5Ly2Uoc-internal" 'False) (C1 ('MetaCons "LoggingContext" 'PrefixI 'True) ((S1 ('MetaSel ('Just "lcNSInner") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Text]) :*: S1 ('MetaSel ('Just "lcNSPrefix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Text])) :*: (S1 ('MetaSel ('Just "lcSeverity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe SeverityS)) :*: (S1 ('MetaSel ('Just "lcPrivacy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Privacy)) :*: S1 ('MetaSel ('Just "lcDetails") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe DetailLevel))))))

data Metric #

Instances

Instances details
Generic Metric 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Associated Types

type Rep Metric :: Type -> Type Source #

Show Metric 
Instance details

Defined in Hermod.Tracing.Types.Annotations

NFData Metric 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Methods

rnf :: Metric -> () Source #

Eq Metric 
Instance details

Defined in Hermod.Tracing.Types.Annotations

type Rep Metric 
Instance details

Defined in Hermod.Tracing.Types.Annotations

data Privacy #

Constructors

Confidential 
Public 

Instances

Instances details
Bounded Privacy 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Enum Privacy 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Generic Privacy 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Associated Types

type Rep Privacy :: Type -> Type Source #

Show Privacy 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Eq Privacy 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Ord Privacy 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Serialise Privacy 
Instance details

Defined in Hermod.Tracing.Types.Annotations

Methods

encode :: Privacy -> Encoding

decode :: Decoder s Privacy

encodeList :: [Privacy] -> Encoding

decodeList :: Decoder s [Privacy]

type Rep Privacy 
Instance details

Defined in Hermod.Tracing.Types.Annotations

type Rep Privacy = D1 ('MetaData "Privacy" "Hermod.Tracing.Types.Annotations" "hermod-tracing-api-1.0.0-LO80W9OfQJv10WJ5Ly2Uoc-internal" 'False) (C1 ('MetaCons "Confidential" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Public" 'PrefixI 'False) (U1 :: Type -> Type))

data ForwarderMode #

Constructors

Initiator 
Responder 

Instances

Instances details
FromJSON ForwarderMode 
Instance details

Defined in Hermod.Tracing.Types.Config

Methods

parseJSON :: Value -> Parser ForwarderMode

parseJSONList :: Value -> Parser [ForwarderMode]

omittedField :: Maybe ForwarderMode

Generic ForwarderMode 
Instance details

Defined in Hermod.Tracing.Types.Config

Associated Types

type Rep ForwarderMode :: Type -> Type Source #

Show ForwarderMode 
Instance details

Defined in Hermod.Tracing.Types.Config

Eq ForwarderMode 
Instance details

Defined in Hermod.Tracing.Types.Config

Ord ForwarderMode 
Instance details

Defined in Hermod.Tracing.Types.Config

type Rep ForwarderMode 
Instance details

Defined in Hermod.Tracing.Types.Config

type Rep ForwarderMode = D1 ('MetaData "ForwarderMode" "Hermod.Tracing.Types.Config" "hermod-tracing-api-1.0.0-LO80W9OfQJv10WJ5Ly2Uoc-internal" 'False) (C1 ('MetaCons "Initiator" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Responder" 'PrefixI 'False) (U1 :: Type -> Type))

data Verbosity #

Constructors

Maximum 
Minimum 

Instances

Instances details
FromJSON Verbosity 
Instance details

Defined in Hermod.Tracing.Types.Config

Methods

parseJSON :: Value -> Parser Verbosity

parseJSONList :: Value -> Parser [Verbosity]

omittedField :: Maybe Verbosity

ToJSON Verbosity 
Instance details

Defined in Hermod.Tracing.Types.Config

Methods

toJSON :: Verbosity -> Value

toEncoding :: Verbosity -> Encoding

toJSONList :: [Verbosity] -> Value

toEncodingList :: [Verbosity] -> Encoding

omitField :: Verbosity -> Bool

Generic Verbosity 
Instance details

Defined in Hermod.Tracing.Types.Config

Associated Types

type Rep Verbosity :: Type -> Type Source #

Show Verbosity 
Instance details

Defined in Hermod.Tracing.Types.Config

Eq Verbosity 
Instance details

Defined in Hermod.Tracing.Types.Config

Ord Verbosity 
Instance details

Defined in Hermod.Tracing.Types.Config

type Rep Verbosity 
Instance details

Defined in Hermod.Tracing.Types.Config

type Rep Verbosity = D1 ('MetaData "Verbosity" "Hermod.Tracing.Types.Config" "hermod-tracing-api-1.0.0-LO80W9OfQJv10WJ5Ly2Uoc-internal" 'False) (C1 ('MetaCons "Maximum" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Minimum" 'PrefixI 'False) (U1 :: Type -> Type))

newtype DocCollector #

Constructors

DocCollector (IORef (Map Int LogDoc)) 

data LogDoc #

Instances

Instances details
Show LogDoc 
Instance details

Defined in Hermod.Tracing.Types.Doc

Eq LogDoc 
Instance details

Defined in Hermod.Tracing.Types.Doc

class LogFormatting a where #

Minimal complete definition

forMachine

Methods

forMachine :: DetailLevel -> a -> Object #

forHuman :: a -> Text #

asMetrics :: a -> [Metric] #

Instances

Instances details
LogFormatting HermodTracingMessage Source # 
Instance details

Defined in Hermod.Tracing.HermodTracingMessage

LogFormatting b => LogFormatting (Folding a b) 
Instance details

Defined in Hermod.Tracing.Types

Methods

forMachine :: DetailLevel -> Folding a b -> Object #

forHuman :: Folding a b -> Text #

asMetrics :: Folding a b -> [Metric] #

newtype Folding a b #

Constructors

Folding b 

Instances

Instances details
LogFormatting b => LogFormatting (Folding a b) 
Instance details

Defined in Hermod.Tracing.Types

Methods

forMachine :: DetailLevel -> Folding a b -> Object #

forHuman :: Folding a b -> Text #

asMetrics :: Folding a b -> [Metric] #

traceWith :: Monad m => Trace m a -> a -> m () #

unfold :: Folding a b -> b #

(>$<) :: Contravariant f => (a -> b) -> f b -> f a infixl 4 Source #

This is an infix alias for contramap.

arrow :: forall (m :: Type -> Type) a. TracerA m a () -> Tracer m a #

configureTracers :: forall a m. (MetaTrace a, MonadIO m) => ConfigReflection -> TraceConfig -> [Trace m a] -> m () Source #

Call this function at initialisation, and later for reconfiguration. Config reflection is used to optimise the tracers and has to collect information about the tracers. Although it is possible to give more then one tracer of the same time, it is not a common case to do this.

withNamespaceConfig :: forall m a b c. (MonadIO m, Ord b) => String -> (TraceConfig -> Namespace a -> m b) -> (Maybe b -> Trace m c -> Trace m a) -> Trace m c -> m (Trace m a) Source #

Take a selector function called extract. Take a function from trace to trace with this config dependent value. In this way construct a trace transformer with a config value

filterSeverityFromConfig :: MonadIO m => Trace m a -> m (Trace m a) Source #

Filter a trace by severity and take the filter value from the config

withDetailsFromConfig :: MonadIO m => Trace m a -> m (Trace m a) Source #

Set detail level of a trace from the config

withBackendsFromConfig :: MonadIO m => (Maybe [BackendConfig] -> Trace m FormattedMessage -> Trace m a) -> m (Trace m a) Source #

Routing and formatting of a trace from the config

withLimitersFromConfig :: forall a m. MonadUnliftIO m => Trace m HermodTracingMessage -> Trace m a -> m (Trace m a) Source #

Routing and formatting of a trace from the config

maybeSilent :: forall m a. MonadIO m => (TraceConfig -> Namespace a -> Bool) -> [Text] -> Bool -> Trace m a -> m (Trace m a) Source #

Switch off any message of a particular tracer based on the configuration. If the top tracer is silent and no subtracer is not silent, then switch it off

getSeverity :: TraceConfig -> Namespace a -> SeverityF Source #

By guaranteeing fallback values in the config's namespace root, the Debug severity value here should never get used. If it has to be used, this points to a severely erroneous config, or an implementation error in the application's MetaTrace instance(s). For those cases only, this ensures the affected trace message isn't silently filtered out.

getDetails :: TraceConfig -> Namespace a -> DetailLevel Source #

If no details can be found in the config, it is set to DNormal

getBackends :: TraceConfig -> Namespace a -> [BackendConfig] Source #

If no backends can be found in the config, it is set to [EKGBackend, Forwarder, Stdout HumanFormatColoured]

limitFrequency :: forall a m. MonadUnliftIO m => Double -> Text -> Trace m HermodTracingMessage -> Trace m a -> m (Trace m a) Source #

Limits the frequency of messages to nMsg which is given per minute.

If the limiter detects more messages, it traces randomly selected messages with the given frequency on the vtracer until the frequency falls under the threshold long enough.(see below)

Before this the ltracer gets a StartLimiting message. In-between you receive ContinueLimiting messages on the ltracer every reminderPeriod seconds, with the number of suppressed messages. Finally it sends a StopLimiting message on the ltracer and traces all messages on the vtracer again.

A budget is used to decide when to start limiting and stop limiting, so that the limiter does not get activated if few messages are send in high frequency, and doesn't get deactivated if their are only few messages which come with low frequency. When messages arrive in shorter frequency then by the given thresholdFrequency budget is earned, and if they arrive in a longer period budget is spend. If budget is gets higher then budgetLimit, the limiter starts, and if it falls below minus budgetLimit the limiter stops.

mkConfiguration :: TraceConfig Source #

Creates the minimal viable configuration by only setting fallback values in an empty TraceConfig. Fallback options for the namespace root: Notice severity, normal detail, JSON stdout logging. Notice severity was chosen as it will never filter out any actionable traces while creating minimal noise in the log.

mkConfigurationWithFallback :: SeverityS -> DetailLevel -> BackendConfig -> TraceConfig Source #

Creates the minimal viable configuration by only setting custom fallback values in an empty TraceConfig. Fallback options for the namespace root: custom values.

readConfiguration :: ConfigSource -> IO TraceConfig Source #

Read a configuration source and return the internal representation. Fallback options for the namespace root: Notice severity, normal detail, JSON stdout logging.

readConfigurationWithFallback :: SeverityS -> DetailLevel -> BackendConfig -> ConfigSource -> IO TraceConfig Source #

Read a configuration source and return the internal representation. Fallback options for the namespace root: custom values.

readConfiguration' :: FilePath -> IO TraceConfig Source #

Read a configuration file and return the internal representation. This will silently provide a minimal viable config via mkConfiguration when the file is absent. Fallback options for the namespace root: Notice severity, normal detail, JSON stdout logging.

readConfigurationWithFallback' :: SeverityS -> DetailLevel -> BackendConfig -> FilePath -> IO TraceConfig Source #

Read a configuration file and return the internal representation. This will silently provide a minimal viable config via mkConfigurationWithFallback when the file is absent. Fallback options for the namespace root: custom values.

readConfigurationWithDefault :: ConfigSource -> TraceConfig -> IO TraceConfig Source #

Read a configuration source and return the internal representation. TraceConfig fields not specified in the file will be taken from the provided defaultConf (when given there). Fallback options for the namespace root: Notice severity, normal detail, JSON stdout logging.

readConfigurationWithFallbackAndDefault :: SeverityS -> DetailLevel -> BackendConfig -> ConfigSource -> TraceConfig -> IO TraceConfig Source #

Read a configuration source and return the internal representation. TraceConfig fields not specified in the file will be taken from the provided defaultConf (when given there). Fallback options for the namespace root: custom values.

applyFallback :: SeverityS -> DetailLevel -> BackendConfig -> TraceConfig -> TraceConfig Source #

Applies the fallback values to the namespace root, or creates a namespace root from them if none is present. Furthermore, it ensures a metric prefix is properly namespaced, if there is one configured. If you do not use any of mkConfiguration* or readConfiguration* to create your TraceConfig, but do it manually, it is highly recommended to call applyFallback on that TraceConfig value as a last step before using it.

configToRepresentation :: TraceConfig -> ConfigRepresentation Source #

Convert config from internal to external representation

checkTraceConfiguration :: ConfigSource -> TraceConfig -> [([Text], [Text])] -> IO NSWarnings Source #

Checks if all namespaces in this configuration are legal. Legal in this case means that it can be found by a hierarchical lookup in all namespaces. Warns if namespaces in all namespaces are not unique, Warns if namespaces in all namespaces are ending in the middle of another namespace. The namespaces in allNamespaces are consistent with the namespaces for the severityFor, privacyFor, detailsFor, documentFor and metricsDocFor functions.

metricsFormatter :: forall a m. (LogFormatting a, MonadIO m) => Trace m FormattedMessage -> Trace m a Source #

Format this trace as metrics

preFormatted :: (LogFormatting a, MonadIO m) => Bool -> Trace m PreFormatted -> Trace m a Source #

Transform this trace to a preformatted message, so that double serialization is avoided

forwardFormatter' :: forall m. MonadIO m => Trace m FormattedMessage -> Trace m PreFormatted Source #

Format this trace as TraceObject for the trace forwarder

machineFormatter' :: forall m. MonadIO m => Trace m FormattedMessage -> Trace m PreFormatted Source #

Format this trace as TraceObject for machine-readable text output (JSON)

cborFormatter' :: forall m. MonadIO m => Trace m FormattedMessage -> Trace m PreFormatted Source #

Format this trace in binary serialisation (CBOR)

humanFormatter' :: forall m. MonadIO m => Bool -> Trace m FormattedMessage -> Trace m PreFormatted Source #

Format this trace in human readable text output

showT :: Show a => a -> Text Source #

Convenience function for a Show instance to be converted to text immediately

filterTrace :: forall (m :: Type -> Type) a. Monad m => ((LoggingContext, a) -> Bool) -> Trace m a -> Trace m a #

mkDataPointTracer :: forall dp. (ToJSON dp, MetaTrace dp, NFData dp) => Trace IO DataPoint -> IO (Trace IO dp) Source #

ekgTracer :: MonadIO m => TraceConfig -> Store -> m (Trace m FormattedMessage) Source #

It is mandatory to construct only one standard tracer in any application! Throwing away a standard tracer and using a new one will result in an exception

standardTracer :: forall m. MonadIO m => m (Trace m FormattedMessage) Source #

The standardTracer handles stdout logging in a thread-safe manner. It is strongly advised to construct only one standardTracer for any application.

forwardTracer :: forall m. MonadIO m => (TraceObject -> IO ()) -> Trace m FormattedMessage Source #

It is mandatory to construct only one forwardTracer tracer in any application! Throwing away a forwardTracer tracer and using a new one will result in an exception

mkHermodTracer :: forall evt. (LogFormatting evt, MetaTrace evt) => Trace IO FormattedMessage -> Trace IO FormattedMessage -> Maybe (Trace IO FormattedMessage) -> [Text] -> IO (Trace IO evt) Source #

Construct a hermod tracer. The tracer gets a name, which is appended to its namespace. The tracer has to be an instance of LogFormatting for the display of messages and an instance of MetaTrace for meta information such as severity, privacy, details and backends'. The tracer gets the backends': trStdout, trForward and mbTrEkg as arguments. The returned tracer needs to be configured with a configuration before it is used.

mkHermodTracer' :: forall evt evt1. (LogFormatting evt1, MetaTrace evt1) => Trace IO FormattedMessage -> Trace IO FormattedMessage -> Maybe (Trace IO FormattedMessage) -> [Text] -> (Trace IO evt1 -> IO (Trace IO evt)) -> IO (Trace IO evt) Source #

Adds the possibility to add special tracers via the hook function

runInLoop :: IO () -> (SomeException -> IO ()) -> Word64 -> Word64 -> IO () Source #

Run an IO action which may throw an exception in a loop. On exception, the action will be re-run after a pause (the delay parameters represent seconds). That pause doubles which each exception, but is reset when the action runs long enough.

nsGetTuple :: Namespace a -> ([Text], [Text]) #

nsRawToText :: ([Text], [Text]) -> Text #

foldCondTraceM :: forall a acc m. MonadUnliftIO m => (acc -> LoggingContext -> a -> m acc) -> acc -> (a -> Bool) -> Trace m (Folding a acc) -> m (Trace m a) #

foldTraceM :: forall a acc m. MonadUnliftIO m => (acc -> LoggingContext -> a -> m acc) -> acc -> Trace m (Folding a acc) -> m (Trace m a) #

routingTrace :: Monad m => (a -> m (Trace m a)) -> Trace m a -> Trace m a #

filterTraceMaybe :: forall (m :: Type -> Type) a. Monad m => Trace m a -> Trace m (Maybe a) #

effect :: (a -> m b) -> TracerA m a b #

emit :: Applicative m => (a -> m ()) -> TracerA m a () #

nat :: (forall x. m x -> n x) -> TracerA m a b -> TracerA n a b #

squelch :: forall (m :: Type -> Type) a. Applicative m => TracerA m a () #

runTracer :: Tracer m a -> TracerA m a () #

debugTracer :: forall (m :: Type -> Type). Applicative m => Tracer m String #

mkTracer :: Applicative m => (a -> m ()) -> Tracer m a #

natTracer :: (forall x. m x -> n x) -> Tracer m s -> Tracer n s #

squelchUnless :: forall (m :: Type -> Type) a. Monad m => (a -> Bool) -> Tracer m a -> Tracer m a #

squelchUnlessM :: Monad m => (a -> m Bool) -> Tracer m a -> Tracer m a #

traceAll :: forall (m :: Type -> Type) t b a. (Monad m, Foldable t) => (b -> t a) -> Tracer m a -> Tracer m b #

traceMaybe :: forall (m :: Type -> Type) a b. Monad m => (a -> Maybe b) -> Tracer m b -> Tracer m a #

traceMaybeM :: Monad m => (a -> m (Maybe b)) -> Tracer m b -> Tracer m a #

traceTraversable :: forall (m :: Type -> Type) t a. (Monad m, Foldable t) => Tracer m a -> Tracer m (t a) #

use :: forall (m :: Type -> Type) a. Tracer m a -> TracerA m a () #

excludeAsyncExceptions :: SomeException -> Maybe SomeException Source #

Helper functions to force trace + metric values in a controlled section of code