mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdserver: add leaseExpired debugging metrics
Fix https://github.com/coreos/etcd/issues/8050. Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
This commit is contained in:
parent
eb3622942b
commit
45fd8279f0
@ -58,6 +58,12 @@ var (
|
|||||||
Name: "proposals_failed_total",
|
Name: "proposals_failed_total",
|
||||||
Help: "The total number of failed proposals seen.",
|
Help: "The total number of failed proposals seen.",
|
||||||
})
|
})
|
||||||
|
leaseExpired = prometheus.NewCounter(prometheus.CounterOpts{
|
||||||
|
Namespace: "etcd_debugging",
|
||||||
|
Subsystem: "server",
|
||||||
|
Name: "lease_expired_total",
|
||||||
|
Help: "The total number of expired leases.",
|
||||||
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -67,6 +73,7 @@ func init() {
|
|||||||
prometheus.MustRegister(proposalsApplied)
|
prometheus.MustRegister(proposalsApplied)
|
||||||
prometheus.MustRegister(proposalsPending)
|
prometheus.MustRegister(proposalsPending)
|
||||||
prometheus.MustRegister(proposalsFailed)
|
prometheus.MustRegister(proposalsFailed)
|
||||||
|
prometheus.MustRegister(leaseExpired)
|
||||||
}
|
}
|
||||||
|
|
||||||
func monitorFileDescriptor(done <-chan struct{}) {
|
func monitorFileDescriptor(done <-chan struct{}) {
|
||||||
|
@ -749,6 +749,7 @@ func (s *EtcdServer) run() {
|
|||||||
s.goAttach(func() {
|
s.goAttach(func() {
|
||||||
ctx := s.authStore.WithRoot(s.ctx)
|
ctx := s.authStore.WithRoot(s.ctx)
|
||||||
s.LeaseRevoke(ctx, &pb.LeaseRevokeRequest{ID: int64(lid)})
|
s.LeaseRevoke(ctx, &pb.LeaseRevokeRequest{ID: int64(lid)})
|
||||||
|
leaseExpired.Inc()
|
||||||
<-c
|
<-c
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user