From 1b0e09369e877ec556910891fa4a9283d2355951 Mon Sep 17 00:00:00 2001 From: Potuz Date: Wed, 27 Mar 2024 15:20:53 -0300 Subject: [PATCH] Add metrics to track pending attestations (#13815) --- beacon-chain/sync/metrics.go | 4 ++++ beacon-chain/sync/pending_attestations_queue.go | 2 ++ 2 files changed, 6 insertions(+) diff --git a/beacon-chain/sync/metrics.go b/beacon-chain/sync/metrics.go index 999339481..07502117a 100644 --- a/beacon-chain/sync/metrics.go +++ b/beacon-chain/sync/metrics.go @@ -150,6 +150,10 @@ var ( Help: "Time to verify gossiped blob sidecars", }, ) + pendingAttCount = promauto.NewCounter(prometheus.CounterOpts{ + Name: "gossip_pending_attestations_total", + Help: "increased when receiving a new pending attestation", + }) // Sync committee verification performance. syncMessagesForUnknownBlocks = promauto.NewCounter( diff --git a/beacon-chain/sync/pending_attestations_queue.go b/beacon-chain/sync/pending_attestations_queue.go index 66d705db6..cb936a933 100644 --- a/beacon-chain/sync/pending_attestations_queue.go +++ b/beacon-chain/sync/pending_attestations_queue.go @@ -177,6 +177,7 @@ func (s *Service) savePendingAtt(att *ethpb.SignedAggregateAttestationAndProof) _, ok := s.blkRootToPendingAtts[root] if !ok { + pendingAttCount.Inc() s.blkRootToPendingAtts[root] = []*ethpb.SignedAggregateAttestationAndProof{att} return } @@ -187,6 +188,7 @@ func (s *Service) savePendingAtt(att *ethpb.SignedAggregateAttestationAndProof) return } } + pendingAttCount.Inc() s.blkRootToPendingAtts[root] = append(s.blkRootToPendingAtts[root], att) }