diff --git a/proxyd/proxyd/consensus_poller.go b/proxyd/proxyd/consensus_poller.go index d52130c..62f7bdf 100644 --- a/proxyd/proxyd/consensus_poller.go +++ b/proxyd/proxyd/consensus_poller.go @@ -369,6 +369,8 @@ func (cp *ConsensusPoller) UpdateBackendGroupConsensus(ctx context.Context) { RecordGroupConsensusLatestBlock(cp.backendGroup, proposedBlock) RecordGroupConsensusCount(cp.backendGroup, len(consensusBackends)) + RecordGroupConsensusFilteredCount(cp.backendGroup, len(filteredBackendsNames)) + RecordGroupTotalCount(cp.backendGroup, len(cp.backendGroup.Backends)) log.Debug("group state", "proposedBlock", proposedBlock, "consensusBackends", strings.Join(consensusBackendsNames, ", "), "filteredBackends", strings.Join(filteredBackendsNames, ", ")) } diff --git a/proxyd/proxyd/metrics.go b/proxyd/proxyd/metrics.go index 6c76fba..efc36ac 100644 --- a/proxyd/proxyd/metrics.go +++ b/proxyd/proxyd/metrics.go @@ -265,7 +265,23 @@ var ( consensusGroupCount = promauto.NewGaugeVec(prometheus.GaugeOpts{ Namespace: MetricsNamespace, Name: "group_consensus_count", - Help: "Consensus group count", + Help: "Consensus group serving traffic count", + }, []string{ + "backend_group_name", + }) + + consensusGroupFilteredCount = promauto.NewGaugeVec(prometheus.GaugeOpts{ + Namespace: MetricsNamespace, + Name: "group_consensus_filtered_count", + Help: "Consensus group filtered out from serving traffic count", + }, []string{ + "backend_group_name", + }) + + consensusGroupTotalCount = promauto.NewGaugeVec(prometheus.GaugeOpts{ + Namespace: MetricsNamespace, + Name: "group_consensus_total_count", + Help: "Total count of candidates to be part of consensus group", }, []string{ "backend_group_name", }) @@ -370,6 +386,14 @@ func RecordGroupConsensusCount(group *BackendGroup, count int) { consensusGroupCount.WithLabelValues(group.Name).Set(float64(count)) } +func RecordGroupConsensusFilteredCount(group *BackendGroup, count int) { + consensusGroupFilteredCount.WithLabelValues(group.Name).Set(float64(count)) +} + +func RecordGroupTotalCount(group *BackendGroup, count int) { + consensusGroupTotalCount.WithLabelValues(group.Name).Set(float64(count)) +} + func RecordBackendLatestBlock(be *Backend, blockNumber hexutil.Uint64) { backendLatestBlockBackend.WithLabelValues(be.Name).Set(float64(blockNumber)) }