HORIZON HASKELLDocslts/ghc-9.14.xd82dee82026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12

Moduletrace-dispatcher-2.13.1Haskell2010

Cardano.Logging.Types

  • 26 types
  • 2 classes
  • 16 values
newtypenewtype Trace (m :: Type -> Type) a
#

The Trace carries the underlying tracer Tracer from the contra-tracer package. It adds a LoggingContext and maybe a TraceControl to every message.

Instances3Contravariant, Semigroup, Monoid
  • Monad m => Contravariant (Trace m)Defined in trace-dispatcher-2.13.1 · Cardano.Logging.Types

    Contramap lifted to Trace

  • Monad m => Semigroup (Trace m a)Defined in trace-dispatcher-2.13.1 · Cardano.Logging.Types

    tr1 <> tr2 will run tr1 and then tr2 with the same input.

  • Monad m => Monoid (Trace m a)Defined in trace-dispatcher-2.13.1 · Cardano.Logging.Types
classclass LogFormatting a where
#

Every message needs this to define how to represent itself

Methods

  • forMachine :: DetailLevel -> a -> Object

    Machine readable representation with the possibility to represent with varying serialisations based on the detail level. This will result in JSON formatted log output. A forMachine implementation is required for any instance definition.

  • forHuman :: a -> Text

    Human-readable representation. The empty text indicates there's no specific human-readable formatting for that type - this is the default implementation.

    If however human-readble output is explicitly requested, e.g. by logs, the system will fall back to a JSON object conforming to the forMachine definition, and rendering it as a value in {"data": value}` Leaving out forHuman in some instance definition will not lead to loss of log information that way.

  • asMetrics :: a -> [Metric]

    Metrics representation. The default indicates that no metric is based on trace occurrences of that type.

Instances3LogFormatting
datadata Metric
#

This type defines metrics, and how to update them.

The Text field always contains the metric name. Metric names are recommended to conform to the Prometheus data model. If you want to structure your metrics in namespaces, please use a dot separator, such as "name.space.metricName".

Example, defining three metrics based on the occurrence of a single trace event:

data Trace = BatchProcessed { batchSize :: Int }

instance LogFormatting Trace where
  asMetrics (BatchProcessed size) =
    [ IntM       "batch.current" (fromIntegral size)        -- element count of the most recent batch
    , CounterM   "batchesTotal"  Nothing                    -- total batches processed (increment by 1)
    , CounterM   "batch.total"   (Just $ fromIntegral size) -- total elements processed
    ]

Constructors

  • IntM Text Integer

    An integer gauge metric. Gauges are variable values.

  • DoubleM Text Double

    A floating-point gauge metric. Gauges are variable values.

  • CounterM Text (Maybe Int)

    A counter metric. Counters are non-negative, monotonically increasing values.

  • PrometheusM Text [(Text, Text)]

    A label set containing the specified key-value pairs. The OpenMetrics standard permits empty label sets; the value of this labeled metric will always be "1".

    For instance, a PrometheusM "foo" [("key1", "value1"), ("key2", "value2")] will be exposed as "foo{key1="value1",key2="value2"} 1"

Instances5Eq, Show, Generic, NFData, Rep
datadata LoggingContext
#
Instances4Show, Generic, Serialise, Rep
datadata Namespace a
#

A unique identifier for every message, composed of text A namespace can as well appear with the tracer name (e.g. ChainDB.OpenEvent.OpenedDB), or more prefixes, in this moment it is a NamespaceOuter is used

Constructors

Instances2Eq, Show
  • Eq (Namespace a)Defined in trace-dispatcher-2.13.1 · Cardano.Logging.Types
  • Show (Namespace a)Defined in trace-dispatcher-2.13.1 · Cardano.Logging.Types
datadata DetailLevel
#

The detail level facilitates rendering the same trace value to messages with varying verbosities in its instance LogFormatting.

Instances11Bounded, Enum, Eq, Ord, Show, Generic, …
datadata Privacy
#

Privacy of a message. Default is Public

Constructors

Instances8Bounded, Enum, Eq, Ord, Show, Generic, …
datadata SeverityS
#

Severity of a message. These are defined alongside message namespaces in an instance MetaTrace.

The severities and their semantics adhere to those defined in the Syslog Protocol.

Constructors

  • Debug

    Debug messages

  • Info

    Informational - confirmation the program is working as expected

  • Notice

    Normal, but significant conditions - may require special handling

  • Warning

    General Warnings

  • Error

    General Errors

  • Critical

    Severe situations

  • Alert

    Take immediate action

  • Emergency

    System is unusable

Instances12Bounded, Enum, Eq, Ord, Read, Show, …
newtypenewtype SeverityF
#

Severity for a filter. These are supplied by a concrete configuration of how to filter the entire message namespace at runtime.

Nothing means: filter everything (Silence).

Just severity means: render messages with SeverityS >= severity.

Constructors

Instances6Enum, Eq, Ord, Show, FromJSON, ToJSON
  • Enum SeverityFDefined in trace-dispatcher-2.13.1 · Cardano.Logging.Types
  • Eq SeverityFDefined in trace-dispatcher-2.13.1 · Cardano.Logging.Types
  • Ord SeverityFDefined in trace-dispatcher-2.13.1 · Cardano.Logging.Types
  • Show SeverityFDefined in trace-dispatcher-2.13.1 · Cardano.Logging.Types
  • FromJSON SeverityFDefined in trace-dispatcher-2.13.1 · Cardano.Logging.Types
  • ToJSON SeverityFDefined in trace-dispatcher-2.13.1 · Cardano.Logging.Types
datadata ConfigOption
#

Constructors

Instances5Eq, Ord, Show, Generic, Rep
datadata ForwarderMode
#

Constructors

  • Initiator

    Forwarder works as a client: it initiates network connection with 'cardano-tracer' and/or another Haskell acceptor application.

  • Responder

    Forwarder works as a server: it accepts network connection from 'cardano-tracer' and/or another Haskell acceptor application.

Instances6Eq, Ord, Show, Generic, FromJSON, Rep
datadata Verbosity
#

Constructors

  • Maximum

    Maximum verbosity for all tracers in the forwarding protocols.

  • Minimum

    Minimum verbosity, the forwarding will work as silently as possible.

Instances7Eq, Ord, Show, Generic, FromJSON, ToJSON, …
datadata TraceOptionForwarder
#
Instances7Eq, Ord, Show, Generic, FromJSON, ToJSON, …
datadata PrometheusSimpleRun
#

Constructors

Instances5Show, Generic, FromJSON, ToJSON, Rep
datadata TraceConfig
#

Constructors

Instances2Show, ToJSON
  • Show TraceConfigDefined in trace-dispatcher-2.13.1 · Cardano.Logging.Types
  • ToJSON TraceConfigDefined in trace-dispatcher-2.13.1 · Cardano.Logging.ConfigurationParser · orphan
datadata LogDoc
#
Instances2Eq, Show
  • Eq LogDocDefined in trace-dispatcher-2.13.1 · Cardano.Logging.Types
  • Show LogDocDefined in trace-dispatcher-2.13.1 · Cardano.Logging.Types
datadata BackendConfig
#
Instances7Eq, Ord, Show, Generic, FromJSON, ToJSON, …
newtypenewtype Folding a b
#

Type for the function foldTraceM from module CardanoLoggingTrace

Constructors

Instances1LogFormatting
datadata TraceObject
#

Used as interface object for ForwarderTracer

Instances6Eq, Show, Generic, NFData, Serialise, Rep
datadata HowToConnect
#

Constructors

Instances7Eq, Show, Generic, NFData, FromJSON, ToJSON, …