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