new metric: network_name (#3018)

This commit is contained in:
Ștefan Talpalaru 2021-10-21 17:13:35 +02:00 committed by GitHub
parent dc3c23788a
commit 99113a4b62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -98,6 +98,8 @@ declareGauge next_action_wait,
declareGauge versionGauge, "Nimbus version info (as metric labels)", ["version", "commit"], name = "version"
versionGauge.set(1, labelValues=[fullVersionStr, gitRevision])
declareGauge network_name, "network name", ["name"]
logScope: topics = "beacnde"
const SlashingDbName = "slashing_protection"
@ -1488,6 +1490,7 @@ proc handleValidatorExitCommand(config: BeaconNodeConf) {.async.} =
quit 1
proc loadEth2Network(config: BeaconNodeConf): Eth2NetworkMetadata {.raises: [Defect, IOError].} =
network_name.set(2, labelValues = [config.eth2Network.get(otherwise = "mainnet")])
if config.eth2Network.isSome:
getMetadataForNetwork(config.eth2Network.get)
else: