diff --git a/consensus/leader.go b/consensus/leader.go index 4a227fa62d..a44b993391 100644 --- a/consensus/leader.go +++ b/consensus/leader.go @@ -131,7 +131,7 @@ func (consensus *Consensus) onPrepare(recvMsg *FBFTMessage) { signerCount := consensus.decider.SignersCount(quorum.Prepare) //// Read - End - consensus.UpdateLeaderMetrics(float64(signerCount), float64(consensus.getBlockNum())) + consensus.SignersCountMetrics(float64(signerCount), float64(consensus.getBlockNum())) // Check BLS signature for the multi-sig prepareSig := recvMsg.Payload diff --git a/consensus/metrics.go b/consensus/metrics.go index fa460f4b7e..fd806062fe 100644 --- a/consensus/metrics.go +++ b/consensus/metrics.go @@ -149,6 +149,12 @@ func (consensus *Consensus) UpdateLeaderMetrics(numCommits float64, blockNum flo consensusCounterVec.With(prometheus.Labels{"consensus": "num_commits"}).Add(numCommits) consensusGaugeVec.With(prometheus.Labels{"consensus": "num_commits"}).Set(numCommits) } + +func (consensus *Consensus) SignersCountMetrics(signersCount float64, blockNum float64) { + consensusCounterVec.With(prometheus.Labels{"consensus": "signers_count"}).Add(signersCount) + consensusGaugeVec.With(prometheus.Labels{"consensus": "signers_count"}).Set(signersCount) +} + func (consensus *Consensus) UpdatePreimageGenerationMetrics( preimageStart uint64, preimageEnd uint64,