start metrics server later in sequence, after BN is initialized (#6902)

This commit is contained in:
tersec 2025-02-06 17:47:53 +00:00 committed by GitHub
parent d98f91b298
commit c673fbe418
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2377,13 +2377,6 @@ proc doRunBeaconNode(config: var BeaconNodeConf, rng: ref HmacDrbgContext) {.rai
config.createDumpDirs() config.createDumpDirs()
let metricsServer = (waitFor config.initMetricsServer()).valueOr:
return
# Nim GC metrics (for the main thread) will be collected in onSecond(), but
# we disable piggy-backing on other metrics here.
setSystemMetricsAutomaticUpdate(false)
# There are no managed event loops in here, to do a graceful shutdown, but # There are no managed event loops in here, to do a graceful shutdown, but
# letting the default Ctrl+C handler exit is safe, since we only read from # letting the default Ctrl+C handler exit is safe, since we only read from
# the db. # the db.
@ -2426,6 +2419,13 @@ proc doRunBeaconNode(config: var BeaconNodeConf, rng: ref HmacDrbgContext) {.rai
let node = waitFor BeaconNode.init(rng, config, metadata) let node = waitFor BeaconNode.init(rng, config, metadata)
let metricsServer = (waitFor config.initMetricsServer()).valueOr:
return
# Nim GC metrics (for the main thread) will be collected in onSecond(), but
# we disable piggy-backing on other metrics here.
setSystemMetricsAutomaticUpdate(false)
node.metricsServer = metricsServer node.metricsServer = metricsServer
if bnStatus == BeaconNodeStatus.Stopping: if bnStatus == BeaconNodeStatus.Stopping: