add slot metric (#1815)

This commit is contained in:
Preston Van Loon 2019-03-03 08:18:27 -05:00 committed by GitHub
parent f5aed821a6
commit f09c66035b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,6 +15,10 @@ var (
}, []string{
"validator",
})
lastSlotGauge = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "state_last_slot",
Help: "Last slot number of the processed state",
})
)
func reportEpochTransitionMetrics(state *pb.BeaconState) {
@ -24,4 +28,6 @@ func reportEpochTransitionMetrics(state *pb.BeaconState) {
"0x" + hex.EncodeToString(state.ValidatorRegistry[i].Pubkey), // Validator
).Set(float64(bal))
}
// Slot number
lastSlotGauge.Set(float64(state.Slot))
}