Skip to content

Commit c673fbe

Browse files
authored
start metrics server later in sequence, after BN is initialized (#6902)
1 parent d98f91b commit c673fbe

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

beacon_chain/nimbus_beacon_node.nim

+7-7
Original file line numberDiff line numberDiff line change
@@ -2377,13 +2377,6 @@ proc doRunBeaconNode(config: var BeaconNodeConf, rng: ref HmacDrbgContext) {.rai
23772377

23782378
config.createDumpDirs()
23792379

2380-
let metricsServer = (waitFor config.initMetricsServer()).valueOr:
2381-
return
2382-
2383-
# Nim GC metrics (for the main thread) will be collected in onSecond(), but
2384-
# we disable piggy-backing on other metrics here.
2385-
setSystemMetricsAutomaticUpdate(false)
2386-
23872380
# There are no managed event loops in here, to do a graceful shutdown, but
23882381
# letting the default Ctrl+C handler exit is safe, since we only read from
23892382
# the db.
@@ -2426,6 +2419,13 @@ proc doRunBeaconNode(config: var BeaconNodeConf, rng: ref HmacDrbgContext) {.rai
24262419

24272420
let node = waitFor BeaconNode.init(rng, config, metadata)
24282421

2422+
let metricsServer = (waitFor config.initMetricsServer()).valueOr:
2423+
return
2424+
2425+
# Nim GC metrics (for the main thread) will be collected in onSecond(), but
2426+
# we disable piggy-backing on other metrics here.
2427+
setSystemMetricsAutomaticUpdate(false)
2428+
24292429
node.metricsServer = metricsServer
24302430

24312431
if bnStatus == BeaconNodeStatus.Stopping:

0 commit comments

Comments
 (0)