From b6f8e4d14731a6d9acc820bb4c4381d8686d125e Mon Sep 17 00:00:00 2001 From: Ben Wilson Date: Sat, 7 Dec 2019 20:48:36 -0500 Subject: [PATCH] Use zcash_chainip_length instead of zcash_chainips_at_height --- collector.go | 10 +++++----- main.go | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/collector.go b/collector.go index 56e66b8..f43a2bb 100644 --- a/collector.go +++ b/collector.go @@ -52,12 +52,12 @@ var ( Help: "Bytes received from peer node."}, []string{"addr", "addrlocal", "inbound", "banscore", "subver"}, ) - zcashdChainTips = prometheus.NewGaugeVec( + zcashdChainTipLength = prometheus.NewGaugeVec( prometheus.GaugeOpts{ - Name: "zcash_chainips_at_height", - Help: "Information about all known tips in the block tree.", + Name: "zcash_chainip_length", + Help: "Chain tip length", }, - []string{"hash", "branchlen", "status"}, + []string{"hash", "status", "height"}, ) ) @@ -97,5 +97,5 @@ func init() { prometheus.MustRegister(zcashdPeerConnTime) prometheus.MustRegister(zcashdPeerBytesSent) prometheus.MustRegister(zcashdPeerBytesRecv) - prometheus.MustRegister(zcashdChainTips) + prometheus.MustRegister(zcashdChainTipLength) } diff --git a/main.go b/main.go index d2094ff..ff3d5c8 100644 --- a/main.go +++ b/main.go @@ -223,11 +223,11 @@ func getChainTips() { } else { for _, ct := range *chaintips { log.Infoln("Got chaintip: ", ct.Hash) - zcashdChainTips.WithLabelValues( + zcashdChainTipLength.WithLabelValues( ct.Hash, - strconv.Itoa(ct.Branchlen), ct.Status, - ).Set(float64(ct.Height)) + strconv.Itoa(ct.Height), + ).Set(float64(ct.Branchlen)) } } time.Sleep(time.Duration(30) * time.Second)