Skip to content

Commit

Permalink
cardano-node: metrics comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jutaro committed Dec 13, 2024
1 parent 2146f13 commit afaf32e
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions cardano-node/src/Cardano/Node/Tracing/Tracers/ChainDB.hs
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ instance ( LogFormatting (Header blk)
| not (null events) ]
++ [ "tipBlockHash" .= tipBlockHash
, "tipBlockParentHash" .= tipBlockParentHash
, "tipBlockIssuerVerificationKeyHash" .= tipBlockIssuerVkHashText]
, "tipBlockIssuerVKeyHash" .= tipBlockIssuerVkHashText]
forMachine dtal (ChainDB.AddedToCurrentChain events selChangedInfo _base extended) =
mconcat $
[ "kind" .= String "AddedToCurrentChain"
Expand Down Expand Up @@ -542,7 +542,7 @@ instance ( LogFormatting (Header blk)
| not (null events) ]
++ [ "tipBlockHash" .= tipBlockHash
, "tipBlockParentHash" .= tipBlockParentHash
, "tipBlockIssuerVerificationKeyHash" .= tipBlockIssuerVkHashText]
, "tipBlockIssuerVKeyHash" .= tipBlockIssuerVkHashText]
forMachine dtal (ChainDB.SwitchedToAFork events selChangedInfo _old new) =
mconcat $
[ "kind" .= String "TraceAddBlockEvent.SwitchedToAFork"
Expand Down Expand Up @@ -606,8 +606,8 @@ instance ( LogFormatting (Header blk)
, IntM "epoch" (fromIntegral (unEpochNo epoch))
, CounterM "forks" (Just (if forkIt then 1 else 0))
, PrometheusM "tipBlock" [("hash",tipBlockHash)
,("parent hash",tipBlockParentHash)
,("issuer verification key hash", tipBlockIssuerVkHashText)]
,("parent_hash",tipBlockParentHash)
,("issuer_VKey_hash", tipBlockIssuerVkHashText)]
]
asMetrics (ChainDB.AddedToCurrentChain _warnings selChangedInfo oldChain newChain) =
let ChainInformation { .. } =
Expand Down Expand Up @@ -745,7 +745,14 @@ instance MetaTrace (ChainDB.TraceAddBlockEvent blk) where
, ( "epoch"
, "In which epoch is the tip of the current chain."
)
, ( "forks"
, "counter for forks"
)
, ( "tipBlock"
, "Hash vallues for tipBlockHash, tipBlockParentHash and tipBlockIssuerVkHashText"
)
]

metricsDocFor (Namespace _ ["AddedToCurrentChain"]) =
[ ( "density"
, mconcat
Expand All @@ -768,6 +775,9 @@ instance MetaTrace (ChainDB.TraceAddBlockEvent blk) where
, ( "epoch"
, "In which epoch is the tip of the current chain."
)
, ( "tipBlock"
, "Hash vallues for tipBlockHash, tipBlockParentHash and tipBlockIssuerVkHashText"
)
]
metricsDocFor _ = []

Expand Down

0 comments on commit afaf32e

Please sign in to comment.