mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-07 05:07:36 +00:00
*: move metric neogo_version
out of pkg/network
Close #3682 Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
This commit is contained in:
parent
dc2d22110f
commit
ebb71497a5
4 changed files with 24 additions and 16 deletions
23
cli/server/metrics.go
Normal file
23
cli/server/metrics.go
Normal file
|
@ -0,0 +1,23 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
|
||||
var neogoVersion = prometheus.NewGaugeVec(
|
||||
prometheus.GaugeOpts{
|
||||
Help: "NeoGo version",
|
||||
Name: "version",
|
||||
Namespace: "neogo",
|
||||
},
|
||||
[]string{"version"})
|
||||
|
||||
func setNeoGoVersion(nodeVer string) {
|
||||
neogoVersion.WithLabelValues(nodeVer).Add(1)
|
||||
}
|
||||
|
||||
func init() {
|
||||
prometheus.MustRegister(
|
||||
neogoVersion,
|
||||
)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue