diff --git a/cardano-node/src/Cardano/TraceDispatcher/Network/P2P.hs b/cardano-node/src/Cardano/TraceDispatcher/Network/P2P.hs index eb054323d73..da9df671ea8 100644 --- a/cardano-node/src/Cardano/TraceDispatcher/Network/P2P.hs +++ b/cardano-node/src/Cardano/TraceDispatcher/Network/P2P.hs @@ -1064,6 +1064,7 @@ instance (Show addr, LogFormatting addr, ToJSON addr) mkObject [ "kind" .= String "ServerError" , "reason" .= show exception ] + forHuman = pack . show docServer :: Documented (ServerTrace ntnAddr) docServer = Documented @@ -1204,6 +1205,16 @@ instance (ToJSON addr, Show addr) mkObject [ "kind" .= String "UnexpectedlyFalseAssertion" , "remoteSt" .= String (pack . show $ info) ] + forHuman = pack . show + asMetrics (TrInboundGovernorCounters InboundGovernorCounters {..}) = + [ IntM + "cardano.node.inbound-governor.warm" + (fromIntegral warmPeersRemote) + , IntM + "cardano.node.inbound-governor.hot" + (fromIntegral hotPeersRemote) + ] + asMetrics _ = [] docInboundGovernor :: Documented (InboundGovernorTrace peerAddr) docInboundGovernor = Documented diff --git a/cardano-node/src/Cardano/TraceDispatcher/Tracers.hs b/cardano-node/src/Cardano/TraceDispatcher/Tracers.hs index 8c78716cf46..dd853303725 100644 --- a/cardano-node/src/Cardano/TraceDispatcher/Tracers.hs +++ b/cardano-node/src/Cardano/TraceDispatcher/Tracers.hs @@ -670,6 +670,27 @@ mkDiffusionTracersExtra trBase trForward mbTrEKG _trDataPoint trConfig EnabledP2 severityInboundGovernor allPublic configureTracers trConfig docInboundGovernor [inboundGovernorTr] + localConnectionManagerTr <- mkCardanoTracer + trBase trForward mbTrEKG + "LocalConnectionManager" + namesForConnectionManager + severityConnectionManager + allPublic + configureTracers trConfig docConnectionManager [localConnectionManagerTr] + localServerTr <- mkCardanoTracer + trBase trForward mbTrEKG + "LocalServer" + namesForServer + severityServer + allPublic + configureTracers trConfig docServer [localServerTr] + localInboundGovernorTr <- mkCardanoTracer + trBase trForward mbTrEKG + "LocalInboundGovernor" + namesForInboundGovernor + severityInboundGovernor + allPublic + configureTracers trConfig docInboundGovernor [localInboundGovernorTr] pure $ Diffusion.P2PTracers P2P.TracersExtra { P2P.dtTraceLocalRootPeersTracer = Tracer $ traceWith localRootPeersTr @@ -690,10 +711,13 @@ mkDiffusionTracersExtra trBase trForward mbTrEKG _trDataPoint trConfig EnabledP2 , P2P.dtServerTracer = Tracer $ traceWith serverTr , P2P.dtInboundGovernorTracer = Tracer $ - traceWith inboundGovernorTr --withMetrics - , P2P.dtLocalConnectionManagerTracer = undefined - , P2P.dtLocalServerTracer = undefined - , P2P.dtLocalInboundGovernorTracer = undefined + traceWith inboundGovernorTr + , P2P.dtLocalConnectionManagerTracer = Tracer $ + traceWith localConnectionManagerTr + , P2P.dtLocalServerTracer = Tracer $ + traceWith localServerTr + , P2P.dtLocalInboundGovernorTracer = Tracer $ + traceWith localInboundGovernorTr } mkDiffusionTracersExtra trBase trForward mbTrEKG _trDataPoint trConfig DisabledP2PMode = do