Skip to content

Commit 4fc73bb

Browse files
authored
Merge pull request #6171 from IntersectMBO/js/tracing-severities
Align tracing severities among tracing systems
2 parents f68fc9b + 788b67d commit 4fc73bb

File tree

2 files changed

+34
-25
lines changed

2 files changed

+34
-25
lines changed

cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1759,7 +1759,7 @@ instance MetaTrace (TraceForgeEvent blk) where
17591759
severityFor (Namespace _ ["LedgerState"]) _ = Just Debug
17601760
severityFor (Namespace _ ["NoLedgerView"]) _ = Just Error
17611761
severityFor (Namespace _ ["LedgerView"]) _ = Just Debug
1762-
severityFor (Namespace _ ["ForgeStateUpdateError"]) _ = Just Error
1762+
severityFor (Namespace _ ["ForgeStateUpdateError"]) _ = Just Critical
17631763
severityFor (Namespace _ ["NodeCannotForge"]) _ = Just Error
17641764
severityFor (Namespace _ ["NodeNotLeader"]) _ = Just Info
17651765
severityFor (Namespace _ ["NodeIsLeader"]) _ = Just Info
@@ -1772,6 +1772,9 @@ instance MetaTrace (TraceForgeEvent blk) where
17721772
severityFor (Namespace _ ["AdoptionThreadDied"]) _ = Just Error
17731773
severityFor _ _ = Nothing
17741774

1775+
privacyFor (Namespace _ ["ForgeStateUpdateError"]) _ = Just Confidential
1776+
privacyFor _ _ = Just Public
1777+
17751778
metricsDocFor (Namespace _ ["StartLeadershipCheck"]) =
17761779
[("Forge.about-to-lead", "")]
17771780
metricsDocFor (Namespace _ ["SlotIsImmutable"]) =

cardano-node/src/Cardano/Tracing/Tracers.hs

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -867,22 +867,24 @@ mkConsensusTracers mbEKGDirect trSel verb tr nodeKern fStats = do
867867
mkForgeTracers :: IO ForgeTracers
868868
mkForgeTracers = do
869869
-- We probably don't want to pay the extra IO cost per-counter-increment. -- sk
870-
staticMeta <- mkLOMeta Critical Confidential
870+
metaCritical <- mkLOMeta Critical Confidential
871+
metaInfo <- mkLOMeta Info Public
872+
metaError <- mkLOMeta Error Public
871873
let name :: LoggerName = "metrics.Forge"
872874
ForgeTracers
873-
<$> counting (liftCounting staticMeta name "forged" tr)
874-
<*> counting (liftCounting staticMeta name "forge-about-to-lead" tr)
875-
<*> counting (liftCounting staticMeta name "could-not-forge" tr)
876-
<*> counting (liftCounting staticMeta name "adopted" tr)
877-
<*> counting (liftCounting staticMeta name "didnt-adopt" tr)
878-
<*> counting (liftCounting staticMeta name "forged-invalid" tr)
879-
<*> counting (liftCounting staticMeta name "node-not-leader" tr)
880-
<*> counting (liftCounting staticMeta name "cannot-forge" tr)
881-
<*> counting (liftCounting staticMeta name "forge-state-update-error" tr)
882-
<*> counting (liftCounting staticMeta name "block-from-future" tr)
883-
<*> counting (liftCounting staticMeta name "slot-is-immutable" tr)
884-
<*> counting (liftCounting staticMeta name "node-is-leader" tr)
885-
<*> counting (liftCounting staticMeta name "adoption-thread-died" tr)
875+
<$> counting (liftCounting metaInfo name "forged" tr)
876+
<*> counting (liftCounting metaInfo name "forge-about-to-lead" tr)
877+
<*> counting (liftCounting metaError name "could-not-forge" tr)
878+
<*> counting (liftCounting metaInfo name "adopted" tr)
879+
<*> counting (liftCounting metaError name "didnt-adopt" tr)
880+
<*> counting (liftCounting metaError name "forged-invalid" tr)
881+
<*> counting (liftCounting metaInfo name "node-not-leader" tr)
882+
<*> counting (liftCounting metaError name "cannot-forge" tr)
883+
<*> counting (liftCounting metaCritical name "forge-state-update-error" tr)
884+
<*> counting (liftCounting metaError name "block-from-future" tr)
885+
<*> counting (liftCounting metaError name "slot-is-immutable" tr)
886+
<*> counting (liftCounting metaInfo name "node-is-leader" tr)
887+
<*> counting (liftCounting metaError name "adoption-thread-died" tr)
886888

887889
traceServedCount :: Maybe EKGDirect -> TraceChainSyncServerEvent blk -> IO ()
888890
traceServedCount Nothing _ = pure ()
@@ -1397,21 +1399,25 @@ forgeStateInfoMetricsTraceTransformer p tr = Tracer $
13971399
$ fromIntegral kesPeriodsUntilExpiry
13981400
]
13991401

1400-
meta <- mkLOMeta Critical Confidential
1401-
mapM_ (traceNamedObject metricsTr . (meta,)) logValues
1402+
metaInfo <- mkLOMeta Info Public
1403+
mapM_ (traceNamedObject metricsTr . (metaInfo,)) logValues
14021404

14031405
-- Trace warning messages on the last 7 KES periods and, in the
14041406
-- final and subsequent KES periods, trace alert messages.
14051407
metaWarning <- mkLOMeta Warning Public
14061408
metaAlert <- mkLOMeta Alert Public
1407-
when (kesPeriodsUntilExpiry <= 7) $
1408-
traceWith tr
1409-
( mempty
1410-
, LogObject
1411-
mempty
1412-
(if kesPeriodsUntilExpiry <= 1 then metaAlert else metaWarning)
1413-
(LogStructuredText mempty (expiryLogMessage kesPeriodsUntilExpiry))
1414-
)
1409+
traceWith tr
1410+
( mempty
1411+
, LogObject
1412+
mempty
1413+
(if kesPeriodsUntilExpiry > 7
1414+
then metaInfo
1415+
else if kesPeriodsUntilExpiry > 1
1416+
then metaWarning
1417+
else metaAlert
1418+
)
1419+
(LogStructuredText mempty (expiryLogMessage kesPeriodsUntilExpiry))
1420+
)
14151421
where
14161422
expiryLogMessage :: Word -> Text
14171423
expiryLogMessage kesPeriodsUntilExpiry =

0 commit comments

Comments
 (0)