Add metric for reorg count (#5819)

* Add reorg counter metric
* Merge branch 'master' into reorg-metric
* Merge branch 'master' into reorg-metric
This commit is contained in:
terence tsao 2020-05-11 22:48:16 -07:00 committed by GitHub
parent edfb32021b
commit 96219fc9fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -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.

View File

@ -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",