Skip to content

Commit 4d56bc9

Browse files
committed
Merge remote-tracking branch 'origin/master' into ana/10.6-final-integration-mix
2 parents 2ad8d26 + 64e8320 commit 4d56bc9

File tree

17 files changed

+99
-72
lines changed

17 files changed

+99
-72
lines changed

cardano-node/cardano-node.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ library
213213
, time
214214
, trace-dispatcher ^>= 2.10.0
215215
, trace-forward ^>= 2.3.0
216-
, trace-resources ^>= 0.2.3
216+
, trace-resources ^>= 0.2.4
217217
, tracer-transformers
218218
, transformers
219219
, transformers-except

cardano-tracer/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## 0.3.5 (October, 2025)
44
* Updated to `ekg-forward-1.0`, `ouroboros-network-0.22.3`, `ouroboros-network-api-0.16`.
5+
* Updated metric names
56

67
## 0.3.4 (July, 2025)
78
* Forwarding protocol supports connections over TCP socket, in addition to Unix domain sockets.

cardano-tracer/cardano-tracer.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ library
199199
, time
200200
, trace-dispatcher ^>= 2.10.0
201201
, trace-forward ^>= 2.3.0
202-
, trace-resources ^>= 0.2.3
202+
, trace-resources ^>= 0.2.4
203203
, wai ^>= 3.2
204204
, warp ^>= 3.4
205205
, yaml

cardano-tracer/src/Cardano/Tracer/Handlers/RTView/Update/Chain.hs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{-# LANGUAGE BangPatterns #-}
2+
{-# LANGUAGE MultiWayIf #-}
23
{-# LANGUAGE OverloadedStrings #-}
34
{-# LANGUAGE ScopedTypeVariables #-}
45

@@ -10,6 +11,7 @@ import Cardano.Tracer.Handlers.RTView.State.Historical
1011
import Cardano.Tracer.Handlers.RTView.Utils
1112
import Cardano.Tracer.Types
1213

14+
import Data.Text (isInfixOf)
1315
import Data.Text.Read (double)
1416
import Data.Time.Clock (UTCTime)
1517

@@ -21,13 +23,13 @@ updateBlockchainHistory
2123
-> UTCTime
2224
-> IO ()
2325
updateBlockchainHistory nodeId (ChainHistory cHistory) metricName metricValue now =
24-
case metricName of
25-
"ChainDB.Density" -> updateChainDensity
26-
"ChainDB.SlotNum" -> updateSlotNum
27-
"ChainDB.BlockNum" -> updateBlockNum
28-
"ChainDB.SlotInEpoch" -> updateSlotInEpoch
29-
"ChainDB.Epoch" -> updateEpoch
30-
_ -> return ()
26+
if
27+
| "density" `isInfixOf` metricName -> updateChainDensity
28+
| "slotNum" `isInfixOf` metricName -> updateSlotNum
29+
| "blockNum" `isInfixOf` metricName -> updateBlockNum
30+
| "slotInEpoch" `isInfixOf` metricName -> updateSlotInEpoch
31+
| "epoch" `isInfixOf` metricName -> updateEpoch
32+
| otherwise -> return ()
3133
where
3234
updateChainDensity =
3335
case double metricValue of

cardano-tracer/src/Cardano/Tracer/Handlers/RTView/Update/KES.hs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{-# LANGUAGE BangPatterns #-}
2+
{-# LANGUAGE MultiWayIf #-}
23
{-# LANGUAGE NamedFieldPuns #-}
34
{-# LANGUAGE OverloadedStrings #-}
45
{-# LANGUAGE ScopedTypeVariables #-}
@@ -18,7 +19,7 @@ import Cardano.Tracer.Utils
1819
import Control.Concurrent.STM.TVar (readTVarIO)
1920
import Control.Monad.Extra (whenJust)
2021
import qualified Data.Map.Strict as M
21-
import Data.Text (pack)
22+
import Data.Text (isInfixOf, pack)
2223
import Data.Text.Read (decimal)
2324
import Text.Printf (printf)
2425

@@ -32,19 +33,19 @@ updateKESInfo
3233
updateKESInfo tracerEnv settings displayed =
3334
forAcceptedMetricsUI_ tracerEnv $ \(nodeId@(NodeId anId), (ekgStore, _)) ->
3435
forMM_ (liftIO $ getListOfMetrics ekgStore) $ \(metricName, metricValue) ->
35-
case metricName of
36-
"Forge.CurrentKESPeriod" ->
37-
setDisplayedValue nodeId displayed (anId <> "__node-current-kes-period") metricValue
38-
"Forge.OperationalCertificateExpiryKESPeriod" ->
39-
setDisplayedValue nodeId displayed (anId <> "__node-op-cert-expiry-kes-period") metricValue
40-
"Forge.OperationalCertificateStartKESPeriod" ->
41-
setDisplayedValue nodeId displayed (anId <> "__node-op-cert-start-kes-period") metricValue
42-
"Forge.RemainingKESPeriods" -> do
36+
if
37+
| "currentKESPeriod" `isInfixOf` metricName ->
38+
setDisplayedValue nodeId displayed (anId <> "__node-current-kes-period") metricValue
39+
| "operationalCertificateExpiryKESPeriod" `isInfixOf` metricName ->
40+
setDisplayedValue nodeId displayed (anId <> "__node-op-cert-expiry-kes-period") metricValue
41+
| "operationalCertificateStartKESPeriod" `isInfixOf` metricName ->
42+
setDisplayedValue nodeId displayed (anId <> "__node-op-cert-start-kes-period") metricValue
43+
| "remainingKESPeriods" `isInfixOf` metricName -> do
4344
setDisplayedValue nodeId displayed (anId <> "__node-remaining-kes-periods") metricValue
4445
allSettings <- liftIO $ readTVarIO settings
4546
whenJust (M.lookup nodeId allSettings) $
4647
setDaysUntilRenew nodeId metricValue
47-
_ -> return ()
48+
| otherwise -> return ()
4849
where
4950
setDaysUntilRenew nodeId@(NodeId anId) metricValue EraSettings{esKESPeriodLength, esSlotLengthInS} = do
5051
case decimal metricValue of

cardano-tracer/src/Cardano/Tracer/Handlers/RTView/Update/Leadership.hs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE MultiWayIf #-}
12
{-# LANGUAGE OverloadedStrings #-}
23
{-# LANGUAGE ScopedTypeVariables #-}
34

@@ -9,6 +10,7 @@ import Cardano.Tracer.Handlers.RTView.State.Historical
910
import Cardano.Tracer.Handlers.RTView.Utils
1011
import Cardano.Tracer.Types
1112

13+
import Data.Text (isInfixOf)
1214
import Data.Time.Clock (UTCTime)
1315

1416
updateLeadershipHistory
@@ -19,26 +21,26 @@ updateLeadershipHistory
1921
-> UTCTime
2022
-> IO ()
2123
updateLeadershipHistory nodeId (ChainHistory cHistory) metricName metricValue now =
22-
case metricName of
24+
if
2325
-- Slot when the node was a leader, but couldn't forge the block.
24-
"Forge.NodeCannotForge" -> updateNodeCannotForge
26+
| "nodeCannotForge" `isInfixOf` metricName -> updateNodeCannotForge
2527
-- Slot when this node forged last block.
26-
"Forge.ForgedSlotLast" -> updateForgedSlotLast
28+
| "forgedSlotLast" `isInfixOf` metricName -> updateForgedSlotLast
2729
-- Slot when this node is leader.
28-
"Forge.NodeIsLeader" -> updateNodeIsLeader
30+
| "Forge.node-is-leader" `isInfixOf` metricName -> updateNodeIsLeader
2931
-- Slot when this node made leadership check and concludes it's not leader.
30-
"Forge.NodeNotLeader" -> updateNodeIsNotLeader
32+
| "Forge.node-not-leader" `isInfixOf` metricName -> updateNodeIsNotLeader
3133
-- Slot when invalid block was forged.
32-
"Forge.ForgedInvalidSlotLast" -> updateForgedInvalidSlotLast
34+
| "Forge.forged-invalid" `isInfixOf` metricName -> updateForgedInvalidSlotLast
3335
-- Slot when the node adopted the block it forged.
34-
"Forge.AdoptedOwnBlockSlotLast" -> updateAdoptedSlotLast
36+
| "Forge.adopted" `isInfixOf` metricName -> updateAdoptedSlotLast
3537
-- Slot when the node didn't adopted the block it forged, but the block was valid.
36-
"Forge.NotAdoptedSlotLast" -> updateNotAdoptedSlotLast
38+
| "Forge.didnt-adopt" `isInfixOf` metricName -> updateNotAdoptedSlotLast
3739
-- Slot when the leadership check is started.
38-
"Forge.AboutToLeadSlotLast" -> updateAboutToLeadSlotLast
40+
| "Forge.about-to-lead" `isInfixOf` metricName -> updateAboutToLeadSlotLast
3941
-- Slot when the leadership check is failed.
40-
"Forge.CouldNotForgeSlotLast" -> updateCouldNotForgeSlotLast
41-
_ -> return ()
42+
| "Forge.could-not-forge" `isInfixOf` metricName -> updateCouldNotForgeSlotLast
43+
| otherwise -> return ()
4244
where
4345
updateNodeCannotForge =
4446
readValueI metricValue $ addHistoricalData cHistory nodeId now NodeCannotForgeData

cardano-tracer/src/Cardano/Tracer/Handlers/RTView/Update/Nodes.hs

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{-# LANGUAGE BangPatterns #-}
22
{-# LANGUAGE LambdaCase #-}
3+
{-# LANGUAGE MultiWayIf #-}
34
{-# LANGUAGE NamedFieldPuns #-}
45
{-# LANGUAGE OverloadedStrings #-}
56
{-# LANGUAGE ScopedTypeVariables #-}
@@ -24,8 +25,8 @@ import Cardano.Tracer.Handlers.RTView.UI.HTML.NoNodes
2425
import Cardano.Tracer.Handlers.RTView.UI.Types
2526
import Cardano.Tracer.Handlers.RTView.UI.Utils
2627
import Cardano.Tracer.Handlers.RTView.Update.NodeInfo
27-
import Cardano.Tracer.Handlers.Utils
2828
import Cardano.Tracer.Handlers.RTView.Utils
29+
import Cardano.Tracer.Handlers.Utils
2930
import Cardano.Tracer.Types
3031
import Cardano.Tracer.Utils
3132

@@ -36,9 +37,9 @@ import Control.Monad.Extra (whenJust, whenJustM, whenM)
3637
import Data.List (find)
3738
import Data.List.NonEmpty (NonEmpty)
3839
import qualified Data.Map.Strict as M
39-
import Data.Maybe (fromMaybe)
4040
import Data.Set (Set, (\\))
4141
import qualified Data.Set as S
42+
import Data.Text (isInfixOf)
4243
import qualified Data.Text as T
4344
import Data.Text.Read (decimal, double)
4445
import Data.Time.Calendar (diffDays)
@@ -253,7 +254,7 @@ setBlockReplayProgress connected acceptedMetrics = do
253254
forM_ connected $ \nodeId ->
254255
whenJust (M.lookup nodeId allMetrics) $ \(ekgStore, _) -> do
255256
metrics <- liftIO $ getListOfMetrics ekgStore
256-
whenJust (lookup "ChainDB.BlockReplayProgress" metrics) $ \metricValue ->
257+
whenJust (find (\(x, _) -> "blockReplayProgress" `isInfixOf` x) metrics) $ \(_, metricValue) ->
257258
updateBlockReplayProgress nodeId metricValue
258259
where
259260
updateBlockReplayProgress (NodeId anId) mValue =
@@ -275,10 +276,7 @@ setProducerMode connected acceptedMetrics = do
275276
forM_ connected $ \nodeId@(NodeId anId) ->
276277
whenJust (M.lookup nodeId allMetrics) $ \(ekgStore, _) ->
277278
forMM_ (liftIO $ getListOfMetrics ekgStore) $ \(mName, _) ->
278-
case mName of
279-
"Forge.NodeIsLeader" -> showProducerMode anId
280-
"Forge.NodeIsLeaderNum" -> showProducerMode anId
281-
_ -> return ()
279+
when ("nodeIsLeader" `isInfixOf` mName) $ showProducerMode anId
282280
where
283281
-- The presence of these metrics is a proof that this node is
284282
-- configured as a producer, so display corresponding icon.
@@ -297,16 +295,16 @@ setLeadershipStats connected displayed acceptedMetrics = do
297295
whenJust (M.lookup nodeId allMetrics) $ \(ekgStore, _) -> do
298296
metrics <- liftIO $ getListOfMetrics ekgStore
299297
forM_ metrics $ \(mName, mValue) ->
300-
case mName of
298+
if
301299
-- How many times this node was a leader.
302-
"Forge.NodeIsLeaderNum" -> setDisplayedValue nodeId displayed (anId <> "__node-leadership") mValue
300+
| "nodeIsLeader" `isInfixOf` mName -> setDisplayedValue nodeId displayed (anId <> "__node-leadership") mValue
303301
-- How many blocks were forged by this node.
304-
"Forge.BlocksForgedNum" -> setDisplayedValue nodeId displayed (anId <> "__node-forged-blocks") mValue
302+
| "blocksForged" `isInfixOf` mName -> setDisplayedValue nodeId displayed (anId <> "__node-forged-blocks") mValue
305303
-- How many times this node could not forge.
306-
"Forge.NodeCannotForgeNum" -> setDisplayedValue nodeId displayed (anId <> "__node-cannot-forge") mValue
304+
| "nodeCannotForge" `isInfixOf` mName -> setDisplayedValue nodeId displayed (anId <> "__node-cannot-forge") mValue
307305
-- How many slots were missed in this node.
308-
"Forge.SlotsMissed" -> setDisplayedValue nodeId displayed (anId <> "__node-missed-slots") mValue
309-
_ -> return ()
306+
| "slotsMissed" `isInfixOf` mName -> setDisplayedValue nodeId displayed (anId <> "__node-missed-slots") mValue
307+
| otherwise -> return ()
310308

311309
setEraEpochInfo
312310
:: Set NodeId
@@ -322,7 +320,7 @@ setEraEpochInfo connected displayed acceptedMetrics nodesEraSettings = do
322320
case M.lookup nodeId allMetrics of
323321
Just (ekgStore, _) -> do
324322
metrics <- liftIO $ getListOfMetrics ekgStore
325-
return $ fromMaybe "" $ lookup "ChainDB.Epoch" metrics
323+
return $ maybe "" snd (find (\(x, _) -> "epoch" `isInfixOf` x) metrics)
326324
Nothing -> return ""
327325
unless (T.null epochS) $
328326
setDisplayedValue nodeId displayed (anId <> "__node-epoch-num") epochS
@@ -377,7 +375,7 @@ setEraEpochInfo connected displayed acceptedMetrics nodesEraSettings = do
377375
updateEpochSlotProgress EraSettings{esEpochLength} nodeId@(NodeId anId) allMetrics =
378376
whenJust (M.lookup nodeId allMetrics) $ \(ekgStore, _) -> do
379377
metrics <- liftIO $ getListOfMetrics ekgStore
380-
whenJust (lookup "ChainDB.SlotInEpoch" metrics) $ \slotInEpochS ->
378+
whenJust (find (\(x, _) -> "slotInEpoch" `isInfixOf` x) metrics) $ \(_, slotInEpochS) ->
381379
case decimal slotInEpochS of
382380
Left _ -> return ()
383381
Right (slotInEpoch :: Int, _) -> do

cardano-tracer/src/Cardano/Tracer/Handlers/RTView/Update/Resources.hs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{-# LANGUAGE NumericUnderscores #-}
33
{-# LANGUAGE OverloadedStrings #-}
44
{-# LANGUAGE ScopedTypeVariables #-}
5+
{-# LANGUAGE MultiWayIf #-}
56

67
module Cardano.Tracer.Handlers.RTView.Update.Resources
78
( updateResourcesHistory
@@ -15,6 +16,7 @@ import Cardano.Tracer.Types
1516

1617
import Control.Concurrent.STM.TVar (readTVarIO)
1718
import qualified Data.Map.Strict as M
19+
import Data.Text (isInfixOf)
1820
import Data.Text.Read (decimal)
1921
import Data.Time.Clock (UTCTime)
2022
import Data.Word (Word64)
@@ -28,16 +30,16 @@ updateResourcesHistory
2830
-> UTCTime
2931
-> IO ()
3032
updateResourcesHistory nodeId (ResHistory rHistory) lastResources metricName metricValue now =
31-
case metricName of
32-
"Stat.cputicks" -> updateCPUUsage
33-
"Mem.resident" -> updateRSSMemory
34-
"RTS.gcLiveBytes" -> updateGCLiveMemory
35-
"RTS.gcMajorNum" -> updateGCMajorNum
36-
"RTS.gcMinorNum" -> updateGCMinorNum
37-
"RTS.gcticks" -> updateCPUTimeGC
38-
"RTS.mutticks" -> updateCPUTimeApp
39-
"Stat.threads" -> updateThreadsNum
40-
_ -> return ()
33+
if
34+
| "Stat.cputicks" `isInfixOf` metricName -> updateCPUUsage
35+
| "Mem.resident" `isInfixOf` metricName -> updateRSSMemory
36+
| "RTS.gcLiveBytes" `isInfixOf` metricName -> updateGCLiveMemory
37+
| "RTS.gcMajorNum" `isInfixOf` metricName -> updateGCMajorNum
38+
| "RTS.gcMinorNum" `isInfixOf` metricName -> updateGCMinorNum
39+
| "RTS.gcticks" `isInfixOf` metricName -> updateCPUTimeGC
40+
| "RTS.mutticks" `isInfixOf` metricName -> updateCPUTimeApp
41+
| "RTS.threads" `isInfixOf` metricName -> updateThreadsNum
42+
| otherwise -> return ()
4143
where
4244
updateCPUUsage =
4345
case decimal metricValue of

cardano-tracer/src/Cardano/Tracer/Handlers/RTView/Update/Transactions.hs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{-# LANGUAGE BangPatterns #-}
2+
{-# LANGUAGE MultiWayIf #-}
23
{-# LANGUAGE OverloadedStrings #-}
34
{-# LANGUAGE ScopedTypeVariables #-}
45

@@ -10,6 +11,7 @@ import Cardano.Tracer.Handlers.RTView.State.Historical
1011
import Cardano.Tracer.Handlers.RTView.Utils
1112
import Cardano.Tracer.Types
1213

14+
import Data.Text (isInfixOf)
1315
import Data.Text.Read (decimal)
1416
import Data.Time.Clock (UTCTime)
1517

@@ -21,11 +23,11 @@ updateTransactionsHistory
2123
-> UTCTime
2224
-> IO ()
2325
updateTransactionsHistory nodeId (TXHistory tHistory) metricName metricValue now =
24-
case metricName of
25-
"Mempool.TxsProcessedNum" -> updateTxsProcessedNum
26-
"Mempool.MempoolBytes" -> updateMempoolBytes
27-
"Mempool.TxsInMempool" -> updateTxsInMempool
28-
_ -> return ()
26+
if
27+
| "txsProcessedNum" `isInfixOf` metricName -> updateTxsProcessedNum
28+
| "mempoolBytes" `isInfixOf` metricName -> updateMempoolBytes
29+
| "txsInMempool" `isInfixOf` metricName -> updateTxsInMempool
30+
| otherwise -> return ()
2931
where
3032
updateTxsProcessedNum =
3133
readValueI metricValue $ addHistoricalData tHistory nodeId now TxsProcessedNumData

scripts/lite/configuration/shelley-1.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ RequiresNetworkMagic: RequiresMagic
3232

3333
##### Update system parameters #####
3434

35-
# This protocol version number gets used by by block producing nodes as part
35+
# This protocol version number gets used by block producing nodes as part
3636
# part of the system for agreeing on and synchronising protocol updates.
3737
LastKnownBlockVersion-Major: 0
3838
LastKnownBlockVersion-Minor: 2

0 commit comments

Comments
 (0)