diff --git a/beacon-chain/blockchain/head.go b/beacon-chain/blockchain/head.go index 898899404..c12247f48 100644 --- a/beacon-chain/blockchain/head.go +++ b/beacon-chain/blockchain/head.go @@ -117,6 +117,8 @@ func (s *Service) saveHead(ctx context.Context, headRoot [32]byte) error { OldSlot: s.headSlot(), }, }) + + reorgCount.Inc() } // Cache the new head info. diff --git a/beacon-chain/blockchain/metrics.go b/beacon-chain/blockchain/metrics.go index e5abdedac..99b0d88ce 100644 --- a/beacon-chain/blockchain/metrics.go +++ b/beacon-chain/blockchain/metrics.go @@ -87,6 +87,10 @@ var ( Name: "total_voted_target_balances", Help: "The total amount of ether, in gwei, that is eligible for voting of previous epoch", }) + reorgCount = promauto.NewCounter(prometheus.CounterOpts{ + Name: "beacon_reorg_total", + Help: "Count the number of times beacon chain has a reorg", + }) sentBlockPropagationHistogram = promauto.NewHistogram( prometheus.HistogramOpts{ Name: "block_sent_latency_milliseconds",