From 0aef63948ff8eba15137b61312a3b2ea48147eac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan=20Talpalaru?= Date: Fri, 9 Jul 2021 07:41:44 +0200 Subject: [PATCH] add version metric (using labels) (#2711) --- beacon_chain/nimbus_beacon_node.nim | 4 +++- beacon_chain/version.nim | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/beacon_chain/nimbus_beacon_node.nim b/beacon_chain/nimbus_beacon_node.nim index a55eeeeca..7a9eba1b3 100644 --- a/beacon_chain/nimbus_beacon_node.nim +++ b/beacon_chain/nimbus_beacon_node.nim @@ -1,4 +1,3 @@ -# beacon_chain # Copyright (c) 2018-2021 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). @@ -97,6 +96,9 @@ declareGauge ticks_delay, declareGauge next_action_wait, "Seconds until the next attestation will be sent" +declareGauge versionGauge, "Nimbus version info (as metric labels)", ["version", "commit"], name = "version" +versionGauge.set(1, labelValues=[fullVersionStr, gitRevision]) + logScope: topics = "beacnde" const SlashingDbName = "slashing_protection" diff --git a/beacon_chain/version.nim b/beacon_chain/version.nim index 95ea89568..0425bc29d 100644 --- a/beacon_chain/version.nim +++ b/beacon_chain/version.nim @@ -1,4 +1,3 @@ -# beacon_chain # Copyright (c) 2018-2021 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). @@ -22,7 +21,7 @@ const gitRevision* = strip(staticExec("git rev-parse --short HEAD"))[0..5] - nimBanner* = staticExec("nim --version | grep -v Compiled") + nimBanner* = staticExec("nim --version | grep Version") versionAsStr* = $versionMajor & "." & $versionMinor & "." & $versionBuild