Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cardano-node/src/Cardano/Node/Protocol/Shelley.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import Cardano.Node.Tracing.Formatting ()
import Cardano.Node.Tracing.Tracers.ChainDB ()
import Cardano.Node.Types
import Cardano.Protocol.Crypto (StandardCrypto)
import qualified Ouroboros.Consensus.Cardano as Consensus
import Ouroboros.Consensus.HardFork.Combinator.AcrossEras ()
import Ouroboros.Consensus.Protocol.Praos.Common (PraosCanBeLeader (..),
Expand Down Expand Up @@ -194,7 +193,7 @@
-- Leios supply one alongside their VRF/KES/opcert credentials.
blsSKey <-
firstExceptT FileError $
traverse (\blsFile -> newExceptT $ readFileTextEnvelope (File blsFile)) mBlsFile

Check warning on line 196 in cardano-node/src/Cardano/Node/Protocol/Shelley.hs

View workflow job for this annotation

GitHub Actions / build

Suggestion in readLeaderCredentialsSingleton in module Cardano.Node.Protocol.Shelley: Avoid lambda ▫︎ Found: "\\ blsFile -> newExceptT $ readFileTextEnvelope (File blsFile)" ▫︎ Perhaps: "newExceptT . readFileTextEnvelope . File"

(credentialsSource, vkey) <- case kesSource of
KESKeyFilePath kesFile -> do
Expand Down
30 changes: 29 additions & 1 deletion cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ import LeiosDemoTypes (AnnouncementFields (..), FetchArrivalBytes (..)
TraceLeiosKernel (..), TraceLeiosPeer (..), traceLeiosKernelToObject,
traceLeiosPeerToObject)
import qualified LeiosDemoTypes as Leios
import LeiosDemoDb.Trace (TraceLeiosDb (..), LeiosDbStats (..))
import LeiosUtils.CallTrace (SomeJsonCallTrace (..), callTraceToObject)

enclosingValue :: ToJSON a => Enclosing' a -> Value
Expand Down Expand Up @@ -2513,6 +2514,12 @@ instance LogFormatting TraceLeiosKernel where
, CounterM "leiosFetchTxsGoodBytes" (Just (fromIntegral (fabGood fab)))
, CounterM "leiosFetchTxsExtraBytes" (Just (fromIntegral (fabExtra fab)))
]
-- Sampled on a timer, so these exist from node start.
TraceLeiosDb (TraceLeiosDbStats (LeiosDbStats { volatileEbs, immutableEbs, walBytes })) ->
[ IntM "leiosDbVolatileEbs" (fromIntegral volatileEbs)
, IntM "leiosDbImmutableEbs" (fromIntegral immutableEbs)
, IntM "leiosDbWalBytes" walBytes
]
_ -> []

instance MetaTrace TraceLeiosKernel where
Expand All @@ -2534,6 +2541,10 @@ instance MetaTrace TraceLeiosKernel where
namespaceFor TraceLeiosVoteScheduled{} = Namespace [] ["VoteScheduled"]
namespaceFor TraceLeiosEbValidated{} = Namespace [] ["EbValidated"]
namespaceFor TraceLeiosDbException{} = Namespace [] ["DbException"]
-- Call spans get their own namespace under Db so their severity and
-- frequency can be configured apart from the stats gauges (a dozen span
-- events per GC vs one stats event).
namespaceFor (TraceLeiosDb TraceLeiosDbCall{}) = Namespace [] ["Db", "Call"]
namespaceFor TraceLeiosDb{} = Namespace [] ["Db"]
namespaceFor TraceLeiosCertifiedAndAnnounced{} = Namespace [] ["CertifiedAndAnnounced"]
namespaceFor TraceLeiosAnnouncementPastHorizon{} = Namespace [] ["AnnouncementPastHorizon"]
Expand All @@ -2546,6 +2557,7 @@ instance MetaTrace TraceLeiosKernel where
-- under the default Notice threshold while its metric still flows to EKG.
severityFor (Namespace _ ["FetchBodyArrival"]) _ = Just Debug
severityFor (Namespace _ ["FetchTxsArrival"]) _ = Just Debug
severityFor (Namespace _ ["Db", "Call"]) _ = Just Debug
severityFor _ _ = Just Info

documentFor _ = Nothing
Expand All @@ -2562,6 +2574,22 @@ instance MetaTrace TraceLeiosKernel where
, ("leiosFetchTxsGoodBytes", "Tx bytes a cached body expected and had not yet held (the expected case).")
, ("leiosFetchTxsExtraBytes", "Tx bytes already held (redundant).")
]
metricsDocFor (Namespace _ ["Db"]) =
[ ("leiosDbVolatileEbs", "LeiosDb: announced EB rows in the volatile partition")
, ("leiosDbVolatileEbTxs", "LeiosDb: EB body rows in the volatile partition")
, ("leiosDbVolatileTxs", "LeiosDb: transactions in the volatile partition")
, ("leiosDbImmutableEbs", "LeiosDb: announced EB rows in the immutable partition")
, ("leiosDbImmutableEbTxs", "LeiosDb: EB body rows in the immutable partition")
, ("leiosDbImmutableTxs", "LeiosDb: transactions in the immutable partition")
, ("leiosDbFileBytes", "LeiosDb: size of the main database file in bytes")
, ("leiosDbWalBytes", "LeiosDb: current size of the write-ahead log in bytes")
, ("leiosDbCopiedEbs", "LeiosDb: announcement rows copied into the immutable partition")
, ("leiosDbCopiedEbTxs", "LeiosDb: EB body rows copied into the immutable partition")
, ("leiosDbCopiedTxs", "LeiosDb: transactions copied into the immutable partition")
, ("leiosDbEvictedEbs", "LeiosDb: announcement rows garbage collected from the volatile partition")
, ("leiosDbEvictedEbTxs", "LeiosDb: EB body rows garbage collected from the volatile partition")
, ("leiosDbEvictedTxs", "LeiosDb: transactions garbage collected from the volatile partition")
]
metricsDocFor _ = []

allNamespaces =
Expand All @@ -2585,6 +2613,7 @@ instance MetaTrace TraceLeiosKernel where
, Namespace [] ["TxCacheEbBody"]
, Namespace [] ["DbException"]
, Namespace [] ["Db"]
, Namespace [] ["Db", "Call"]
, Namespace [] ["CertifiedAndAnnounced"]
, Namespace [] ["AnnouncementPastHorizon"]
, Namespace [] ["AnnouncementAccepted"]
Expand Down Expand Up @@ -2615,4 +2644,3 @@ instance MetaTrace TraceLeiosPeer where
, Namespace [] ["DbException"]
, Namespace [] ["Announcement"]
]

Loading