add version metric (using labels) (#2711)

This commit is contained in:
Ștefan Talpalaru 2021-07-09 07:41:44 +02:00 committed by GitHub
parent eb2dc5cbbb
commit 0aef63948f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -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"

View File

@ -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