{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE QuantifiedConstraints #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeApplications #-}
{-# OPTIONS_GHC -Wno-orphans #-}

module Cardano.Node.Tracing.Documentation
  ( TraceDocumentationCmd (..)
  , parseTraceDocumentationCmd
  , runTraceDocumentationCmd
  , docTracers
  ) where

import           Control.Exception (SomeException)
import           Data.Aeson.Types (ToJSON)
import           Data.Proxy (Proxy (..))
import qualified Data.Text.IO as T
import           GHC.Generics (Generic)
import           Network.Mux (MuxTrace (..), WithMuxBearer (..))
import qualified Network.Socket as Socket
import qualified Options.Applicative as Opt

import           Cardano.Logging
import           Cardano.Logging.Resources
import           Cardano.Logging.Resources.Types ()

import           Cardano.Node.Tracing.DefaultTraceConfig (defaultCardanoConfig)
import           Cardano.Node.Tracing.Formatting ()
import qualified Cardano.Node.Tracing.StateRep as SR
import           Cardano.Node.Tracing.Tracers.BlockReplayProgress
import           Cardano.Node.Tracing.Tracers.ChainDB
import           Cardano.Node.Tracing.Tracers.Consensus
import           Cardano.Node.Tracing.Tracers.Diffusion ()
-- import           Cardano.Node.Tracing.Tracers.ForgingThreadStats (ForgeThreadStats,
--                    forgeThreadStats, ForgingStats)
import           Cardano.Node.Tracing.Tracers.KESInfo ()
import           Cardano.Node.Tracing.Tracers.NodeToClient ()
import           Cardano.Node.Tracing.Tracers.NodeToNode ()
import           Cardano.Node.Tracing.Tracers.NonP2P ()
import           Cardano.Node.Tracing.Tracers.P2P ()
import           Cardano.Node.Tracing.Tracers.Peer
import           Cardano.Node.Tracing.Tracers.Shutdown ()
import           Cardano.Node.Tracing.Tracers.Startup ()

import           Cardano.Node.Handlers.Shutdown (ShutdownTrace)
import           Cardano.Node.Startup
import           Cardano.Node.TraceConstraints

import           Ouroboros.Consensus.Block.Forging
import           Ouroboros.Consensus.BlockchainTime.WallClock.Types (RelativeTime)
import           Ouroboros.Consensus.BlockchainTime.WallClock.Util (TraceBlockchainTimeEvent (..))
import           Ouroboros.Consensus.Cardano.Block
import           Ouroboros.Consensus.Ledger.Inspect
import           Ouroboros.Consensus.Ledger.Query (Query, ShowQuery)
import           Ouroboros.Consensus.Ledger.SupportsMempool (ApplyTxErr, GenTxId,
                   LedgerSupportsMempool)
import           Ouroboros.Consensus.Ledger.SupportsProtocol
import           Ouroboros.Consensus.Mempool (TraceEventMempool (..))
import           Ouroboros.Consensus.MiniProtocol.BlockFetch.Server
                   (TraceBlockFetchServerEvent (..))
import           Ouroboros.Consensus.MiniProtocol.ChainSync.Client (TraceChainSyncClientEvent)
import           Ouroboros.Consensus.MiniProtocol.ChainSync.Server (TraceChainSyncServerEvent)
import           Ouroboros.Consensus.MiniProtocol.LocalTxSubmission.Server
                   (TraceLocalTxSubmissionServerEvent (..))
import           Ouroboros.Consensus.Node.NetworkProtocolVersion
import qualified Ouroboros.Consensus.Node.Run as Consensus
import qualified Ouroboros.Consensus.Node.Tracers as Consensus
import qualified Ouroboros.Consensus.Protocol.Ledger.HotKey as HotKey
import qualified Ouroboros.Consensus.Storage.ChainDB as ChainDB


import           Ouroboros.Network.Block (Point (..), SlotNo, Tip)
import qualified Ouroboros.Network.BlockFetch.ClientState as BlockFetch
import           Ouroboros.Network.BlockFetch.Decision
import           Ouroboros.Network.ConnectionHandler (ConnectionHandlerTrace (..))
import           Ouroboros.Network.ConnectionId (ConnectionId)
import           Ouroboros.Network.ConnectionManager.Types (ConnectionManagerTrace (..))
import qualified Ouroboros.Network.ConnectionManager.Types as ConnectionManager
import qualified Ouroboros.Network.Diffusion as Diffusion
import           Ouroboros.Network.Driver.Simple (TraceSendRecv)
import           Ouroboros.Network.InboundGovernor (InboundGovernorTrace)
import qualified Ouroboros.Network.InboundGovernor as InboundGovernor
import           Ouroboros.Network.KeepAlive (TraceKeepAliveClient (..))
import qualified Ouroboros.Network.NodeToClient as NtC
import           Ouroboros.Network.NodeToNode (ErrorPolicyTrace (..), RemoteAddress, WithAddr (..))
import qualified Ouroboros.Network.NodeToNode as NtN
import           Ouroboros.Network.PeerSelection.Governor (DebugPeerSelection (..),
                   PeerSelectionCounters (..), TracePeerSelection (..))
import           Ouroboros.Network.PeerSelection.LedgerPeers (TraceLedgerPeers)
import           Ouroboros.Network.PeerSelection.PeerStateActions (PeerSelectionActionsTrace (..))
import           Ouroboros.Network.PeerSelection.RootPeersDNS (TraceLocalRootPeers (..),
                   TracePublicRootPeers (..))
import           Ouroboros.Network.Protocol.BlockFetch.Type (BlockFetch)
import           Ouroboros.Network.Protocol.ChainSync.Type (ChainSync)
import           Ouroboros.Network.Protocol.Handshake.Unversioned (UnversionedProtocol (..),
                   UnversionedProtocolData (..))
import           Ouroboros.Network.Protocol.LocalStateQuery.Type (LocalStateQuery)
import qualified Ouroboros.Network.Protocol.LocalTxMonitor.Type as LTM
import qualified Ouroboros.Network.Protocol.LocalTxSubmission.Type as LTS
import           Ouroboros.Network.Protocol.TxSubmission2.Type (TxSubmission2)
import           Ouroboros.Network.Server2 (ServerTrace (..))
import           Ouroboros.Network.Snocket (LocalAddress (..))
import           Ouroboros.Network.Subscription.Dns (DnsTrace (..), WithDomainName (..))
import           Ouroboros.Network.Subscription.Ip (WithIPList (..))
import           Ouroboros.Network.Subscription.Worker (SubscriptionTrace (..))
import           Ouroboros.Network.TxSubmission.Inbound (TraceTxSubmissionInbound)
import           Ouroboros.Network.TxSubmission.Outbound (TraceTxSubmissionOutbound)

import           Cardano.Api.Orphans ()

data TraceDocumentationCmd
  = TraceDocumentationCmd
    { TraceDocumentationCmd -> FilePath
tdcConfigFile :: FilePath
    , TraceDocumentationCmd -> FilePath
tdcOutput     :: FilePath
    }

parseTraceDocumentationCmd :: Opt.Parser TraceDocumentationCmd
parseTraceDocumentationCmd :: Parser TraceDocumentationCmd
parseTraceDocumentationCmd =
  forall a. Mod CommandFields a -> Parser a
Opt.subparser
    (forall a. Monoid a => [a] -> a
mconcat
     [ forall a. FilePath -> Mod CommandFields a
Opt.commandGroup FilePath
"Miscellaneous commands"
     , forall (f :: * -> *) a. HasMetavar f => FilePath -> Mod f a
Opt.metavar FilePath
"trace-documentation"
     , forall (f :: * -> *) a. Mod f a
Opt.hidden
     , forall a. FilePath -> ParserInfo a -> Mod CommandFields a
Opt.command FilePath
"trace-documentation" forall a b. (a -> b) -> a -> b
$
       forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info
         (FilePath -> FilePath -> TraceDocumentationCmd
TraceDocumentationCmd
           forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall s. IsString s => Mod OptionFields s -> Parser s
Opt.strOption
               ( forall (f :: * -> *) a. HasName f => FilePath -> Mod f a
Opt.long FilePath
"config"
                 forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. HasMetavar f => FilePath -> Mod f a
Opt.metavar FilePath
"NODE-CONFIGURATION"
                 forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. FilePath -> Mod f a
Opt.help FilePath
"Configuration file for the cardano-node"
               )
           forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> forall s. IsString s => Mod OptionFields s -> Parser s
Opt.strOption
               ( forall (f :: * -> *) a. HasName f => FilePath -> Mod f a
Opt.long FilePath
"output-file"
                 forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. HasMetavar f => FilePath -> Mod f a
Opt.metavar FilePath
"FILE"
                 forall a. Semigroup a => a -> a -> a
<> forall (f :: * -> *) a. FilePath -> Mod f a
Opt.help FilePath
"Generated documentation output file"
               )
           forall (f :: * -> *) a b. Applicative f => f a -> f (a -> b) -> f b
Opt.<**> forall a. Parser (a -> a)
Opt.helper)
       forall a b. (a -> b) -> a -> b
$ forall a. Monoid a => [a] -> a
mconcat [ forall a. FilePath -> InfoMod a
Opt.progDesc FilePath
"Generate the trace documentation" ]
     ]
    )

deriving instance Generic UnversionedProtocol
deriving instance Generic UnversionedProtocolData

instance ToJSON UnversionedProtocol
instance ToJSON UnversionedProtocolData

runTraceDocumentationCmd
  :: TraceDocumentationCmd
  -> IO ()
runTraceDocumentationCmd :: TraceDocumentationCmd -> IO ()
runTraceDocumentationCmd TraceDocumentationCmd{FilePath
tdcOutput :: FilePath
tdcConfigFile :: FilePath
tdcOutput :: TraceDocumentationCmd -> FilePath
tdcConfigFile :: TraceDocumentationCmd -> FilePath
..} = do
  forall blk peer remotePeer.
(TraceConstraints blk, InspectLedger blk,
 LedgerSupportsMempool blk, LedgerSupportsProtocol blk,
 SerialiseNodeToNodeConstraints blk, LogFormatting peer,
 LogFormatting remotePeer, Show (BlockNodeToClientVersion blk),
 Show (BlockNodeToNodeVersion blk), Show remotePeer, Show peer,
 Show (ForgeStateUpdateError blk), Show (CannotForge blk),
 ShowQuery (BlockQuery blk)) =>
FilePath
-> FilePath -> Proxy blk -> Proxy peer -> Proxy remotePeer -> IO ()
docTracers
    FilePath
tdcConfigFile FilePath
tdcOutput (forall {k} (t :: k). Proxy t
Proxy @(CardanoBlock StandardCrypto))
                            (forall {k} (t :: k). Proxy t
Proxy @(NtN.ConnectionId LocalAddress))
                            (forall {k} (t :: k). Proxy t
Proxy @(NtN.ConnectionId NtN.RemoteAddress))

-- Have to repeat the construction of the tracers here,
-- as the tracers are behind old tracer interface after construction in mkDispatchTracers.
-- Can be changed, when old tracers have gone
docTracers :: forall blk peer remotePeer.
  ( TraceConstraints blk
  , InspectLedger blk
  , LedgerSupportsMempool blk
  , LedgerSupportsProtocol blk
  , Consensus.SerialiseNodeToNodeConstraints blk
  , LogFormatting peer
  , LogFormatting remotePeer
  , Show (BlockNodeToClientVersion blk)
  , Show (BlockNodeToNodeVersion blk)
  , Show remotePeer
  , Show peer
  , Show (ForgeStateUpdateError blk)
  , Show (CannotForge blk)
  , ShowQuery (BlockQuery blk)
  )
  => FilePath
  -> FilePath
  -> Proxy blk
  -> Proxy peer
  -> Proxy remotePeer
  -> IO ()
docTracers :: forall blk peer remotePeer.
(TraceConstraints blk, InspectLedger blk,
 LedgerSupportsMempool blk, LedgerSupportsProtocol blk,
 SerialiseNodeToNodeConstraints blk, LogFormatting peer,
 LogFormatting remotePeer, Show (BlockNodeToClientVersion blk),
 Show (BlockNodeToNodeVersion blk), Show remotePeer, Show peer,
 Show (ForgeStateUpdateError blk), Show (CannotForge blk),
 ShowQuery (BlockQuery blk)) =>
FilePath
-> FilePath -> Proxy blk -> Proxy peer -> Proxy remotePeer -> IO ()
docTracers FilePath
configFileName FilePath
outputFileName Proxy blk
_ Proxy peer
_ Proxy remotePeer
_ = do
    TraceConfig
trConfig      <- FilePath -> TraceConfig -> IO TraceConfig
readConfigurationWithDefault FilePath
configFileName TraceConfig
defaultCardanoConfig
    let Trace IO FormattedMessage
trBase    :: Trace IO FormattedMessage = forall (m :: * -> *).
MonadIO m =>
BackendConfig -> Trace m FormattedMessage
docTracer (FormatLogging -> BackendConfig
Stdout FormatLogging
MachineFormat)
        Trace IO FormattedMessage
trForward :: Trace IO FormattedMessage = forall (m :: * -> *).
MonadIO m =>
BackendConfig -> Trace m FormattedMessage
docTracer BackendConfig
Forwarder
        trDataPoint :: Trace IO DataPoint
trDataPoint = forall (m :: * -> *).
MonadIO m =>
BackendConfig -> Trace m DataPoint
docTracerDatapoint BackendConfig
DatapointBackend
        Maybe (Trace IO FormattedMessage)
mbTrEKG   :: Maybe (Trace IO FormattedMessage) = forall a. a -> Maybe a
Just (forall (m :: * -> *).
MonadIO m =>
BackendConfig -> Trace m FormattedMessage
docTracer BackendConfig
EKGBackend)

    ConfigReflection
configReflection <- IO ConfigReflection
emptyConfigReflection

    -- NodeInfo tracer
    Trace IO NodeInfo
nodeInfoTr <- forall dp.
(ToJSON dp, MetaTrace dp) =>
Trace IO DataPoint -> IO (Trace IO dp)
mkDataPointTracer
                    Trace IO DataPoint
trDataPoint
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig  [Trace IO NodeInfo
nodeInfoTr]
    DocTracer
nodeInfoTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO NodeInfo
nodeInfoTr :: Trace IO NodeInfo)

    Trace IO NodeStartupInfo
nodeStartupInfoTr <- forall dp.
(ToJSON dp, MetaTrace dp) =>
Trace IO DataPoint -> IO (Trace IO dp)
mkDataPointTracer
                Trace IO DataPoint
trDataPoint
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO NodeStartupInfo
nodeStartupInfoTr]
    DocTracer
nodeStartupInfoTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer
                      (Trace IO NodeStartupInfo
nodeStartupInfoTr :: Trace IO NodeStartupInfo)

    -- State tracer
    Trace IO NodeState
stateTr   <- forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"NodeState"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO NodeState
stateTr]
    DocTracer
stateTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO NodeState
stateTr :: Trace IO SR.NodeState)

    --  Peers tracer

    Trace IO [PeerT blk]
peersTr   <- forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"Net", Text
"Peers", Text
"List"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO [PeerT blk]
peersTr]
    DocTracer
peersTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO [PeerT blk]
peersTr :: Trace IO  [PeerT blk])

    -- Resource tracer
    Trace IO ResourceStats
resourcesTr <- forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                []
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO ResourceStats
resourcesTr]
    DocTracer
resourcesTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO ResourceStats
resourcesTr :: Trace IO ResourceStats)

    -- Startup tracer
    Trace IO (StartupTrace blk)
startupTr <- forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"Startup"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (StartupTrace blk)
startupTr]
    DocTracer
startupTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (StartupTrace blk)
startupTr :: Trace IO (StartupTrace blk))

    Trace IO ShutdownTrace
shutdownTr <- forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"Shutdown"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig  [Trace IO ShutdownTrace
shutdownTr]
    DocTracer
shutdownTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO ShutdownTrace
shutdownTr :: Trace IO ShutdownTrace)


    Trace IO (TraceEvent blk)
chainDBTr <- 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)
mkCardanoTracer'
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"ChainDB"]
                forall blk.
Trace IO (TraceEvent blk) -> IO (Trace IO (TraceEvent blk))
withAddedToCurrentChainEmptyLimited
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (TraceEvent blk)
chainDBTr]
    DocTracer
chainDBTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (TraceEvent blk)
chainDBTr ::
                      Trace IO (ChainDB.TraceEvent blk))

    Trace IO ReplayBlockStats
replayBlockTr <- forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"ChainDB", Text
"ReplayBlock"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO ReplayBlockStats
replayBlockTr]
    DocTracer
replayBlockTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO ReplayBlockStats
replayBlockTr :: Trace IO ReplayBlockStats)

-- Consensus tracers

    Trace
  IO
  (TraceLabelPeer
     (ConnectionId RemoteAddress) (TraceChainSyncClientEvent blk))
chainSyncClientTr  <- forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"ChainSync", Text
"Client"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace
  IO
  (TraceLabelPeer
     (ConnectionId RemoteAddress) (TraceChainSyncClientEvent blk))
chainSyncClientTr]
    DocTracer
chainSyncClientTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace
  IO
  (TraceLabelPeer
     (ConnectionId RemoteAddress) (TraceChainSyncClientEvent blk))
chainSyncClientTr ::
      (Trace IO (BlockFetch.TraceLabelPeer
                  (ConnectionId RemoteAddress)
                  (TraceChainSyncClientEvent blk))))

    Trace IO (TraceChainSyncServerEvent blk)
chainSyncServerHeaderTr <- forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"ChainSync", Text
"ServerHeader"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (TraceChainSyncServerEvent blk)
chainSyncServerHeaderTr]
    DocTracer
chainSyncServerHeaderTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (TraceChainSyncServerEvent blk)
chainSyncServerHeaderTr ::
      (Trace IO (TraceChainSyncServerEvent blk)))

    Trace IO (TraceChainSyncServerEvent blk)
chainSyncServerBlockTr <- forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"ChainSync", Text
"ServerBlock"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (TraceChainSyncServerEvent blk)
chainSyncServerBlockTr]
    DocTracer
chainSyncServerBlockTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (TraceChainSyncServerEvent blk)
chainSyncServerBlockTr ::
      (Trace IO (TraceChainSyncServerEvent blk)))

    Trace
  IO [TraceLabelPeer remotePeer (FetchDecision [Point (Header blk)])]
blockFetchDecisionTr  <- forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"BlockFetch", Text
"Decision"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace
  IO [TraceLabelPeer remotePeer (FetchDecision [Point (Header blk)])]
blockFetchDecisionTr]
    DocTracer
blockFetchDecisionTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace
  IO [TraceLabelPeer remotePeer (FetchDecision [Point (Header blk)])]
blockFetchDecisionTr ::
       Trace IO [BlockFetch.TraceLabelPeer
                                      remotePeer
                                      (FetchDecision [Point (Header blk)])])

    Trace
  IO (TraceLabelPeer remotePeer (TraceFetchClientState (Header blk)))
blockFetchClientTr  <- forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"BlockFetch", Text
"Client"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace
  IO (TraceLabelPeer remotePeer (TraceFetchClientState (Header blk)))
blockFetchClientTr]
    DocTracer
blockFetchClientTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace
  IO (TraceLabelPeer remotePeer (TraceFetchClientState (Header blk)))
blockFetchClientTr ::
      Trace IO (BlockFetch.TraceLabelPeer
                  remotePeer
                  (BlockFetch.TraceFetchClientState (Header blk))))

    -- TODO Yup
    -- blockFetchClientMetricsTr <- do
    --         foldMTraceM calculateBlockFetchClientMetrics initialClientMetrics
    --             (metricsFormatter ""
    --               (mkMetricsTracer mbTrEKG))
    -- clientMetricsDoc <- documentTracer (blockFetchClientMetricsTr ::
    --    Trace IO ClientMetrics)

    Trace IO (TraceBlockFetchServerEvent blk)
blockFetchServerTr  <- forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"BlockFetch", Text
"Server"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (TraceBlockFetchServerEvent blk)
blockFetchServerTr]
    DocTracer
blockFetchServerTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (TraceBlockFetchServerEvent blk)
blockFetchServerTr ::
      Trace IO (TraceBlockFetchServerEvent blk))

    Trace IO (TraceLabelCreds KESInfo)
forgeKESInfoTr  <- forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"Forge", Text
"KESInfo"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (TraceLabelCreds KESInfo)
forgeKESInfoTr]
    DocTracer
forgeKESInfoTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (TraceLabelCreds KESInfo)
forgeKESInfoTr ::
      Trace IO (Consensus.TraceLabelCreds HotKey.KESInfo))

    Trace
  IO
  (TraceLabelPeer
     remotePeer (TraceTxSubmissionInbound (GenTxId blk) (GenTx blk)))
txInboundTr  <- forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"TxSubmission", Text
"TxInbound"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace
  IO
  (TraceLabelPeer
     remotePeer (TraceTxSubmissionInbound (GenTxId blk) (GenTx blk)))
txInboundTr]
    DocTracer
txInboundTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace
  IO
  (TraceLabelPeer
     remotePeer (TraceTxSubmissionInbound (GenTxId blk) (GenTx blk)))
txInboundTr ::
      Trace IO (BlockFetch.TraceLabelPeer
                  remotePeer
                  (TraceTxSubmissionInbound (GenTxId blk) (GenTx blk))))

    Trace
  IO
  (TraceLabelPeer
     remotePeer (TraceTxSubmissionOutbound (GenTxId blk) (GenTx blk)))
txOutboundTr  <- forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"TxSubmission", Text
"TxOutbound"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace
  IO
  (TraceLabelPeer
     remotePeer (TraceTxSubmissionOutbound (GenTxId blk) (GenTx blk)))
txOutboundTr]
    DocTracer
txOutboundTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace
  IO
  (TraceLabelPeer
     remotePeer (TraceTxSubmissionOutbound (GenTxId blk) (GenTx blk)))
txOutboundTr ::
      Trace IO (BlockFetch.TraceLabelPeer
                  remotePeer
                  (TraceTxSubmissionOutbound (GenTxId blk) (GenTx blk))))

    Trace IO (TraceLocalTxSubmissionServerEvent blk)
localTxSubmissionServerTr <- forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"TxSubmission", Text
"LocalServer"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (TraceLocalTxSubmissionServerEvent blk)
localTxSubmissionServerTr]
    DocTracer
localTxSubmissionServerTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (TraceLocalTxSubmissionServerEvent blk)
localTxSubmissionServerTr ::
      Trace IO (TraceLocalTxSubmissionServerEvent blk))

    Trace IO (TraceEventMempool blk)
mempoolTr   <- forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"Mempool"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (TraceEventMempool blk)
mempoolTr]
    DocTracer
mempoolTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (TraceEventMempool blk)
mempoolTr ::
      Trace IO (TraceEventMempool blk))

    Trace IO (ForgeTracerType blk)
forgeTr <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"Forge", Text
"Loop"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (ForgeTracerType blk)
forgeTr]
    DocTracer
forgeTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (ForgeTracerType blk)
forgeTr ::
      Trace IO (ForgeTracerType blk))

    -- TODO YUP
    -- forgeTr' <-  mkCardanoTracer'
    --             trBase trForward mbTrEKG
    --             ["Forge", "Loop"]
    --             forgeThreadStats
    -- configureTracers configReflection trConfig [forgeTr']
    -- forgeThreadStatsTrDoc <- documentTracer' forgeThreadStats (forgeTr' ::
    --   Trace IO (ForgeTracerType blk))

    Trace IO (TraceBlockchainTimeEvent RelativeTime)
blockchainTimeTr <- forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"BlockchainTime"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (TraceBlockchainTimeEvent RelativeTime)
blockchainTimeTr]
    DocTracer
blockchainTimeTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (TraceBlockchainTimeEvent RelativeTime)
blockchainTimeTr ::
      Trace IO (TraceBlockchainTimeEvent RelativeTime))

-- Node to client

    Trace IO (TraceKeepAliveClient peer)
keepAliveClientTr <- forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"Net"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (TraceKeepAliveClient peer)
keepAliveClientTr]
    DocTracer
keepAliveClientTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (TraceKeepAliveClient peer)
keepAliveClientTr ::
      Trace IO (TraceKeepAliveClient peer))

    Trace
  IO
  (TraceLabelPeer
     peer
     (TraceSendRecv (ChainSync (Header blk) (Point blk) (Tip blk))))
chainSyncTr <- forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                 [Text
"ChainSync", Text
"Local"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace
  IO
  (TraceLabelPeer
     peer
     (TraceSendRecv (ChainSync (Header blk) (Point blk) (Tip blk))))
chainSyncTr]
    DocTracer
chainSyncTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace
  IO
  (TraceLabelPeer
     peer
     (TraceSendRecv (ChainSync (Header blk) (Point blk) (Tip blk))))
chainSyncTr ::
      Trace IO
        (BlockFetch.TraceLabelPeer peer (TraceSendRecv
          (ChainSync (Header blk) (Point blk) (Tip blk)))))

    Trace
  IO
  (TraceLabelPeer
     peer
     (TraceSendRecv (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo)))
txMonitorTr <-
      forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
        Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
        [Text
"TxSubmission", Text
"MonitorClient"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace
  IO
  (TraceLabelPeer
     peer
     (TraceSendRecv (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo)))
txMonitorTr]
    DocTracer
txMonitorTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace
  IO
  (TraceLabelPeer
     peer
     (TraceSendRecv (LocalTxMonitor (GenTxId blk) (GenTx blk) SlotNo)))
txMonitorTr ::
      Trace IO
        (BlockFetch.TraceLabelPeer
           peer
           (TraceSendRecv
              (LTM.LocalTxMonitor
                 (GenTxId blk) (GenTx blk) SlotNo))))

    Trace
  IO
  (TraceLabelPeer
     peer
     (TraceSendRecv (LocalTxSubmission (GenTx blk) (ApplyTxErr blk))))
txSubmissionTr  <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"TxSubmission", Text
"Local"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace
  IO
  (TraceLabelPeer
     peer
     (TraceSendRecv (LocalTxSubmission (GenTx blk) (ApplyTxErr blk))))
txSubmissionTr]
    DocTracer
txSubmissionTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace
  IO
  (TraceLabelPeer
     peer
     (TraceSendRecv (LocalTxSubmission (GenTx blk) (ApplyTxErr blk))))
txSubmissionTr ::
      Trace IO
         (BlockFetch.TraceLabelPeer
            peer
            (TraceSendRecv
               (LTS.LocalTxSubmission
                  (GenTx blk) (ApplyTxErr blk)))))

    Trace
  IO
  (TraceLabelPeer
     peer (TraceSendRecv (LocalStateQuery blk (Point blk) (Query blk))))
stateQueryTr  <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
               [Text
"StateQueryServer"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace
  IO
  (TraceLabelPeer
     peer (TraceSendRecv (LocalStateQuery blk (Point blk) (Query blk))))
stateQueryTr]
    DocTracer
stateQueryTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace
  IO
  (TraceLabelPeer
     peer (TraceSendRecv (LocalStateQuery blk (Point blk) (Query blk))))
stateQueryTr ::
      Trace IO
            (BlockFetch.TraceLabelPeer peer
             (TraceSendRecv
               (LocalStateQuery blk (Point blk) (Query blk)))))

-- Node to Node

    Trace
  IO
  (TraceLabelPeer
     peer
     (TraceSendRecv (ChainSync (Header blk) (Point blk) (Tip blk))))
chainSyncNodeTr <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"ChainSync", Text
"Remote"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace
  IO
  (TraceLabelPeer
     peer
     (TraceSendRecv (ChainSync (Header blk) (Point blk) (Tip blk))))
chainSyncNodeTr]
    DocTracer
chainSyncNodeTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace
  IO
  (TraceLabelPeer
     peer
     (TraceSendRecv (ChainSync (Header blk) (Point blk) (Tip blk))))
chainSyncNodeTr ::
      Trace IO (BlockFetch.TraceLabelPeer peer (TraceSendRecv
          (ChainSync (Header blk) (Point blk) (Tip blk)))))

    Trace
  IO
  (TraceLabelPeer
     peer
     (TraceSendRecv (ChainSync (Header blk) (Point blk) (Tip blk))))
chainSyncSerialisedTr <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                 [Text
"ChainSync", Text
"Remote", Text
"Serialised"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace
  IO
  (TraceLabelPeer
     peer
     (TraceSendRecv (ChainSync (Header blk) (Point blk) (Tip blk))))
chainSyncSerialisedTr]
    DocTracer
chainSyncSerialisedTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace
  IO
  (TraceLabelPeer
     peer
     (TraceSendRecv (ChainSync (Header blk) (Point blk) (Tip blk))))
chainSyncSerialisedTr ::
      Trace IO (BlockFetch.TraceLabelPeer peer (TraceSendRecv
            (ChainSync (Header blk) (Point blk) (Tip blk)))))

    Trace
  IO
  (TraceLabelPeer peer (TraceSendRecv (BlockFetch blk (Point blk))))
blockFetchTr  <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"BlockFetch", Text
"Remote"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace
  IO
  (TraceLabelPeer peer (TraceSendRecv (BlockFetch blk (Point blk))))
blockFetchTr]
    DocTracer
blockFetchTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace
  IO
  (TraceLabelPeer peer (TraceSendRecv (BlockFetch blk (Point blk))))
blockFetchTr ::
      Trace IO
            (BlockFetch.TraceLabelPeer peer
             (TraceSendRecv
               (BlockFetch blk (Point blk)))))

    Trace
  IO
  (TraceLabelPeer peer (TraceSendRecv (BlockFetch blk (Point blk))))
blockFetchSerialisedTr <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"BlockFetch", Text
"Remote", Text
"Serialised"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace
  IO
  (TraceLabelPeer peer (TraceSendRecv (BlockFetch blk (Point blk))))
blockFetchSerialisedTr]
    DocTracer
blockFetchSerialisedTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace
  IO
  (TraceLabelPeer peer (TraceSendRecv (BlockFetch blk (Point blk))))
blockFetchSerialisedTr ::
      Trace IO
            (BlockFetch.TraceLabelPeer peer
             (TraceSendRecv
               (BlockFetch blk (Point blk)))))

    Trace
  IO
  (TraceLabelPeer
     peer (TraceSendRecv (TxSubmission2 (GenTxId blk) (GenTx blk))))
txSubmission2Tr  <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"TxSubmission", Text
"Remote"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace
  IO
  (TraceLabelPeer
     peer (TraceSendRecv (TxSubmission2 (GenTxId blk) (GenTx blk))))
txSubmission2Tr]
    DocTracer
txSubmission2TrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace
  IO
  (TraceLabelPeer
     peer (TraceSendRecv (TxSubmission2 (GenTxId blk) (GenTx blk))))
txSubmission2Tr ::
      Trace IO
        (BlockFetch.TraceLabelPeer peer
          (TraceSendRecv
            (TxSubmission2 (GenTxId blk) (GenTx blk)))))

-- Diffusion
    Trace IO (WithMuxBearer (ConnectionId RemoteAddress) MuxTrace)
dtMuxTr   <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"Net", Text
"Mux", Text
"Remote"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (WithMuxBearer (ConnectionId RemoteAddress) MuxTrace)
dtMuxTr]
    DocTracer
dtMuxTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (WithMuxBearer (ConnectionId RemoteAddress) MuxTrace)
dtMuxTr ::
      Trace IO (WithMuxBearer (ConnectionId RemoteAddress) MuxTrace))

    Trace IO (WithMuxBearer (ConnectionId LocalAddress) MuxTrace)
dtLocalMuxTr   <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"Net", Text
"Mux", Text
"Local"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (WithMuxBearer (ConnectionId LocalAddress) MuxTrace)
dtLocalMuxTr]
    DocTracer
dtLocalMuxTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (WithMuxBearer (ConnectionId LocalAddress) MuxTrace)
dtLocalMuxTr ::
      Trace IO (WithMuxBearer (ConnectionId LocalAddress) MuxTrace))

    Trace IO (HandshakeTr RemoteAddress NodeToNodeVersion)
dtHandshakeTr   <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"Net", Text
"Handshake", Text
"Remote"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (HandshakeTr RemoteAddress NodeToNodeVersion)
dtHandshakeTr]
    DocTracer
dtHandshakeTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (HandshakeTr RemoteAddress NodeToNodeVersion)
dtHandshakeTr ::
      Trace IO (NtN.HandshakeTr NtN.RemoteAddress NtN.NodeToNodeVersion))

    Trace IO (HandshakeTr LocalAddress NodeToClientVersion)
dtLocalHandshakeTr  <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                 [Text
"Net", Text
"Handshake", Text
"Local"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (HandshakeTr LocalAddress NodeToClientVersion)
dtLocalHandshakeTr]
    DocTracer
dtLocalHandshakeTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (HandshakeTr LocalAddress NodeToClientVersion)
dtLocalHandshakeTr ::
      Trace IO
        (NtC.HandshakeTr LocalAddress NtC.NodeToClientVersion))

    Trace IO (DiffusionTracer RemoteAddress LocalAddress)
dtDiffusionInitializationTr   <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"Startup", Text
"DiffusionInit"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (DiffusionTracer RemoteAddress LocalAddress)
dtDiffusionInitializationTr]
    DocTracer
dtDiffusionInitializationTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (DiffusionTracer RemoteAddress LocalAddress)
dtDiffusionInitializationTr ::
      Trace IO (Diffusion.DiffusionTracer Socket.SockAddr LocalAddress))

    Trace IO TraceLedgerPeers
dtLedgerPeersTr  <- forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"Net", Text
"Peers", Text
"Ledger"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO TraceLedgerPeers
dtLedgerPeersTr]
    DocTracer
dtLedgerPeersTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO TraceLedgerPeers
dtLedgerPeersTr ::
      Trace IO TraceLedgerPeers)

-- DiffusionTracersExtra P2P

    Trace IO (TraceLocalRootPeers RemoteAddress SomeException)
localRootPeersTr  <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
      Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
      [Text
"Net", Text
"Peers", Text
"LocalRoot"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (TraceLocalRootPeers RemoteAddress SomeException)
localRootPeersTr]
    DocTracer
localRootPeersTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (TraceLocalRootPeers RemoteAddress SomeException)
localRootPeersTr ::
      Trace IO (TraceLocalRootPeers RemoteAddress SomeException))

    Trace IO TracePublicRootPeers
publicRootPeersTr  <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
      Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
      [Text
"Net", Text
"Peers", Text
"PublicRoot"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO TracePublicRootPeers
publicRootPeersTr]
    DocTracer
publicRootPeersTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO TracePublicRootPeers
publicRootPeersTr ::
      Trace IO TracePublicRootPeers)

    Trace IO (TracePeerSelection RemoteAddress)
peerSelectionTr  <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
      Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
      [Text
"Net", Text
"PeerSelection", Text
"Selection"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (TracePeerSelection RemoteAddress)
peerSelectionTr]
    DocTracer
peerSelectionTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (TracePeerSelection RemoteAddress)
peerSelectionTr ::
      Trace IO (TracePeerSelection Socket.SockAddr))

    Trace IO (DebugPeerSelection RemoteAddress)
debugPeerSelectionTr  <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
      Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
      [Text
"Net", Text
"PeerSelection", Text
"Initiator"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (DebugPeerSelection RemoteAddress)
debugPeerSelectionTr]
    DocTracer
debugPeerSelectionTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (DebugPeerSelection RemoteAddress)
debugPeerSelectionTr ::
      Trace IO (DebugPeerSelection Socket.SockAddr))

    Trace IO (DebugPeerSelection RemoteAddress)
debugPeerSelectionResponderTr  <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
      Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
      [Text
"Net", Text
"PeerSelection", Text
"Responder"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (DebugPeerSelection RemoteAddress)
debugPeerSelectionResponderTr]
    DocTracer
debugPeerSelectionResponderTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (DebugPeerSelection RemoteAddress)
debugPeerSelectionResponderTr ::
      Trace IO (DebugPeerSelection Socket.SockAddr))

    Trace IO PeerSelectionCounters
peerSelectionCountersTr  <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
      Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
      [Text
"Net", Text
"PeerSelection", Text
"Counters"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO PeerSelectionCounters
peerSelectionCountersTr]
    DocTracer
peerSelectionCountersTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO PeerSelectionCounters
peerSelectionCountersTr ::
      Trace IO PeerSelectionCounters)

    Trace IO (PeerSelectionActionsTrace RemoteAddress LocalAddress)
peerSelectionActionsTr  <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
      Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
      [Text
"Net", Text
"PeerSelection", Text
"Actions"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (PeerSelectionActionsTrace RemoteAddress LocalAddress)
peerSelectionActionsTr]
    DocTracer
peerSelectionActionsTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (PeerSelectionActionsTrace RemoteAddress LocalAddress)
peerSelectionActionsTr ::
      Trace IO (PeerSelectionActionsTrace Socket.SockAddr LocalAddress))

    Trace
  IO
  (ConnectionManagerTrace
     RemoteAddress
     (ConnectionHandlerTrace
        UnversionedProtocol UnversionedProtocolData))
connectionManagerTr  <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
      Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
      [Text
"Net", Text
"ConnectionManager", Text
"Remote"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace
  IO
  (ConnectionManagerTrace
     RemoteAddress
     (ConnectionHandlerTrace
        UnversionedProtocol UnversionedProtocolData))
connectionManagerTr]
    DocTracer
connectionManagerTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace
  IO
  (ConnectionManagerTrace
     RemoteAddress
     (ConnectionHandlerTrace
        UnversionedProtocol UnversionedProtocolData))
connectionManagerTr ::
      Trace IO
        (ConnectionManagerTrace
          Socket.SockAddr
          (ConnectionHandlerTrace UnversionedProtocol UnversionedProtocolData)))

    Trace IO (AbstractTransitionTrace RemoteAddress)
connectionManagerTransitionsTr  <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
      Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
      [Text
"Net", Text
"ConnectionManager", Text
"Remote"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (AbstractTransitionTrace RemoteAddress)
connectionManagerTransitionsTr]
    DocTracer
connectionManagerTransitionsTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (AbstractTransitionTrace RemoteAddress)
connectionManagerTransitionsTr ::
      Trace IO (ConnectionManager.AbstractTransitionTrace Socket.SockAddr))


    Trace IO (ServerTrace RemoteAddress)
serverTr  <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
      Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
      [Text
"Net", Text
"Server", Text
"Remote"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (ServerTrace RemoteAddress)
serverTr]
    DocTracer
serverTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (ServerTrace RemoteAddress)
serverTr ::
      Trace IO (ServerTrace Socket.SockAddr))

    Trace IO (InboundGovernorTrace RemoteAddress)
inboundGovernorTr  <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
      Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
       [Text
"Net", Text
"InboundGovernor", Text
"Remote"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (InboundGovernorTrace RemoteAddress)
inboundGovernorTr]
    DocTracer
inboundGovernorTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (InboundGovernorTrace RemoteAddress)
inboundGovernorTr ::
      Trace IO (InboundGovernorTrace Socket.SockAddr))

    Trace IO (RemoteTransitionTrace RemoteAddress)
inboundGovernorTransitionsTr  <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
      Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
      [Text
"Net", Text
"InboundGovernor", Text
"Remote", Text
"Transition"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (RemoteTransitionTrace RemoteAddress)
inboundGovernorTransitionsTr]
    DocTracer
inboundGovernorTransitionsTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (RemoteTransitionTrace RemoteAddress)
inboundGovernorTransitionsTr ::
       Trace IO (InboundGovernor.RemoteTransitionTrace Socket.SockAddr))

    Trace
  IO
  (ConnectionManagerTrace
     RemoteAddress
     (ConnectionHandlerTrace
        UnversionedProtocol UnversionedProtocolData))
localConnectionManagerTr  <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
      Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
       [Text
"Net", Text
"ConnectionManager", Text
"Local"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace
  IO
  (ConnectionManagerTrace
     RemoteAddress
     (ConnectionHandlerTrace
        UnversionedProtocol UnversionedProtocolData))
localConnectionManagerTr]
    DocTracer
localConnectionManagerTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace
  IO
  (ConnectionManagerTrace
     RemoteAddress
     (ConnectionHandlerTrace
        UnversionedProtocol UnversionedProtocolData))
localConnectionManagerTr ::
      Trace IO
        (ConnectionManagerTrace
          Socket.SockAddr
          (ConnectionHandlerTrace
            UnversionedProtocol
            UnversionedProtocolData)))

    Trace IO (ServerTrace LocalAddress)
localServerTr  <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
      Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
      [Text
"Net", Text
"Server", Text
"Local"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (ServerTrace LocalAddress)
localServerTr]
    DocTracer
localServerTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (ServerTrace LocalAddress)
localServerTr ::
      Trace IO (ServerTrace LocalAddress))

    Trace IO (InboundGovernorTrace LocalAddress)
localInboundGovernorTr  <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
      Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
       [Text
"Net", Text
"InboundGovernor", Text
"Local"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (InboundGovernorTrace LocalAddress)
localInboundGovernorTr]
    DocTracer
localInboundGovernorTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (InboundGovernorTrace LocalAddress)
localInboundGovernorTr ::
      Trace IO (InboundGovernorTrace LocalAddress))

-- -- DiffusionTracersExtra nonP2P

    Trace IO (WithIPList (SubscriptionTrace RemoteAddress))
dtIpSubscriptionTr   <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"Net", Text
"Subscription", Text
"IP"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (WithIPList (SubscriptionTrace RemoteAddress))
dtIpSubscriptionTr]
    DocTracer
dtIpSubscriptionTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (WithIPList (SubscriptionTrace RemoteAddress))
dtIpSubscriptionTr ::
      Trace IO (WithIPList (SubscriptionTrace Socket.SockAddr)))

    Trace IO (WithDomainName (SubscriptionTrace RemoteAddress))
dtDnsSubscriptionTr  <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"Net", Text
"Subscription", Text
"DNS"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (WithDomainName (SubscriptionTrace RemoteAddress))
dtDnsSubscriptionTr]
    DocTracer
dtDnsSubscriptionTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (WithDomainName (SubscriptionTrace RemoteAddress))
dtDnsSubscriptionTr ::
      Trace IO (WithDomainName (SubscriptionTrace Socket.SockAddr)))

    Trace IO (WithDomainName DnsTrace)
dtDnsResolverTr  <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"Net", Text
"DNSResolver"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (WithDomainName DnsTrace)
dtDnsResolverTr]
    DocTracer
dtDnsResolverTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (WithDomainName DnsTrace)
dtDnsResolverTr ::
      Trace IO (WithDomainName DnsTrace))

    Trace IO (WithAddr RemoteAddress ErrorPolicyTrace)
dtErrorPolicyTr  <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"Net", Text
"ErrorPolicy", Text
"Remote"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (WithAddr RemoteAddress ErrorPolicyTrace)
dtErrorPolicyTr]
    DocTracer
dtErrorPolicyTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (WithAddr RemoteAddress ErrorPolicyTrace)
dtErrorPolicyTr ::
      Trace IO (WithAddr Socket.SockAddr ErrorPolicyTrace))

    Trace IO (WithAddr LocalAddress ErrorPolicyTrace)
dtLocalErrorPolicyTr <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"Net", Text
"ErrorPolicy", Text
"Local"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO (WithAddr LocalAddress ErrorPolicyTrace)
dtLocalErrorPolicyTr]
    DocTracer
dtLocalErrorPolicyTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO (WithAddr LocalAddress ErrorPolicyTrace)
dtLocalErrorPolicyTr ::
      Trace IO (WithAddr LocalAddress ErrorPolicyTrace))

    Trace IO AcceptConnectionsPolicyTrace
dtAcceptPolicyTr    <-  forall evt.
(LogFormatting evt, MetaTrace evt) =>
Trace IO FormattedMessage
-> Trace IO FormattedMessage
-> Maybe (Trace IO FormattedMessage)
-> [Text]
-> IO (Trace IO evt)
mkCardanoTracer
                Trace IO FormattedMessage
trBase Trace IO FormattedMessage
trForward Maybe (Trace IO FormattedMessage)
mbTrEKG
                [Text
"Net", Text
"AcceptPolicy"]
    forall a (m :: * -> *).
(MetaTrace a, MonadIO m) =>
ConfigReflection -> TraceConfig -> [Trace m a] -> m ()
configureTracers ConfigReflection
configReflection TraceConfig
trConfig [Trace IO AcceptConnectionsPolicyTrace
dtAcceptPolicyTr]
    DocTracer
dtAcceptPolicyTrDoc <- forall a. MetaTrace a => Trace IO a -> IO DocTracer
documentTracer (Trace IO AcceptConnectionsPolicyTrace
dtAcceptPolicyTr ::
      Trace IO NtN.AcceptConnectionsPolicyTrace)

    let bl :: DocTracer
bl =   DocTracer
nodeInfoTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
stateTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
nodeStartupInfoTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
resourcesTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
startupTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
shutdownTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
peersTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
chainDBTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
replayBlockTrDoc
-- Consensus
            forall a. Semigroup a => a -> a -> a
<> DocTracer
chainSyncClientTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
chainSyncServerHeaderTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
chainSyncServerBlockTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
blockFetchDecisionTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
blockFetchClientTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
blockFetchServerTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
forgeKESInfoTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
txInboundTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
txOutboundTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
localTxSubmissionServerTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
mempoolTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
forgeTrDoc
--            <> forgeThreadStatsTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
blockchainTimeTrDoc
-- NodeToClient
            forall a. Semigroup a => a -> a -> a
<> DocTracer
keepAliveClientTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
chainSyncTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
txMonitorTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
txSubmissionTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
stateQueryTrDoc
-- Node to Node
            forall a. Semigroup a => a -> a -> a
<> DocTracer
chainSyncNodeTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
chainSyncSerialisedTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
blockFetchTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
blockFetchSerialisedTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
txSubmission2TrDoc
-- Diffusion
            forall a. Semigroup a => a -> a -> a
<> DocTracer
dtMuxTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
dtLocalMuxTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
dtHandshakeTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
dtLocalHandshakeTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
dtDiffusionInitializationTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
dtLedgerPeersTrDoc
-- DiffusionTracersExtra P2P
            forall a. Semigroup a => a -> a -> a
<> DocTracer
localRootPeersTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
publicRootPeersTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
peerSelectionTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
debugPeerSelectionTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
debugPeerSelectionResponderTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
peerSelectionCountersTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
peerSelectionActionsTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
connectionManagerTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
connectionManagerTransitionsTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
serverTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
inboundGovernorTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
inboundGovernorTransitionsTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
localConnectionManagerTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
localServerTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
localInboundGovernorTrDoc
-- DiffusionTracersExtra nonP2P
            forall a. Semigroup a => a -> a -> a
<> DocTracer
dtIpSubscriptionTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
dtDnsSubscriptionTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
dtDnsResolverTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
dtErrorPolicyTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
dtLocalErrorPolicyTrDoc
            forall a. Semigroup a => a -> a -> a
<> DocTracer
dtAcceptPolicyTrDoc

    Text
res <- DocTracer -> TraceConfig -> IO Text
docuResultsToText DocTracer
bl TraceConfig
trConfig
    FilePath -> Text -> IO ()
T.writeFile FilePath
outputFileName Text
res
    forall (f :: * -> *) a. Applicative f => a -> f a
pure ()