From a6167680b44c1cbb366aeff9d65faa0a14aa5aec Mon Sep 17 00:00:00 2001 From: Edmund Noble Date: Sun, 26 May 2024 23:22:41 -0400 Subject: [PATCH] log: disable top-level monitors when telemetry is disabled This has the nice side effect of also disabling the warning that RTS stats are disabled when telemetry is off, because RTS stats don't matter in that case. Change-Id: I4111672ccc18760184d3325c0cd998c3c91fd6d2 --- changes/2024-05-30T145629-0400.txt | 1 + node/ChainwebNode.hs | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 changes/2024-05-30T145629-0400.txt diff --git a/changes/2024-05-30T145629-0400.txt b/changes/2024-05-30T145629-0400.txt new file mode 100644 index 0000000000..09d9f45e77 --- /dev/null +++ b/changes/2024-05-30T145629-0400.txt @@ -0,0 +1 @@ +Disable telemetry monitor threads when telemetry is disabled anyway diff --git a/node/ChainwebNode.hs b/node/ChainwebNode.hs index 909c8db449..4ef1f37158 100644 --- a/node/ChainwebNode.hs +++ b/node/ChainwebNode.hs @@ -351,15 +351,22 @@ node conf logger = do logFunctionText logger Info $ "backup config: " <> sshow (_configBackup cwConf) withChainweb cwConf logger rocksDb pactDbDir dbBackupsDir (_nodeConfigResetChainDbs conf) $ \case Replayed _ _ -> return () - StartedChainweb cw -> + StartedChainweb cw -> do + let telemetryEnabled = + _enableConfigEnabled $ _logConfigTelemetryBackend $ _nodeConfigLog conf concurrentlies_ [ runChainweb cw (\_ -> return ()) -- we should probably push 'onReady' deeper here but this should be ok - , runCutMonitor (_chainwebLogger cw) (_cutResCutDb $ _chainwebCutResources cw) - , runQueueMonitor (_chainwebLogger cw) (_cutResCutDb $ _chainwebCutResources cw) - , runRtsMonitor (_chainwebLogger cw) - , runBlockUpdateMonitor (_chainwebLogger cw) (_cutResCutDb $ _chainwebCutResources cw) - , runDatabaseMonitor (_chainwebLogger cw) rocksDbDir pactDbDir + , when telemetryEnabled $ + runCutMonitor (_chainwebLogger cw) (_cutResCutDb $ _chainwebCutResources cw) + , when telemetryEnabled $ + runQueueMonitor (_chainwebLogger cw) (_cutResCutDb $ _chainwebCutResources cw) + , when telemetryEnabled $ + runRtsMonitor (_chainwebLogger cw) + , when telemetryEnabled $ + runBlockUpdateMonitor (_chainwebLogger cw) (_cutResCutDb $ _chainwebCutResources cw) + , when telemetryEnabled $ + runDatabaseMonitor (_chainwebLogger cw) rocksDbDir pactDbDir ] where cwConf = _nodeConfigChainweb conf