Skip to content
/ etcd Public
forked from etcd-io/etcd

Commit

Permalink
etcdserver: add leaseRevoked metrics
Browse files Browse the repository at this point in the history
Fix etcd-io#8050.

Signed-off-by: Gyu-Ho Lee <[email protected]>
  • Loading branch information
gyuho committed Jun 8, 2017
1 parent eb36229 commit 6df9c4a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions etcdserver/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ var (
Name: "proposals_failed_total",
Help: "The total number of failed proposals seen.",
})
leaseRevoked = prometheus.NewGauge(prometheus.GaugeOpts{
Namespace: "etcd",
Subsystem: "server",
Name: "lease_revoked_total",
Help: "The total number of lease revoked.",
})
)

func init() {
Expand All @@ -67,6 +73,7 @@ func init() {
prometheus.MustRegister(proposalsApplied)
prometheus.MustRegister(proposalsPending)
prometheus.MustRegister(proposalsFailed)
prometheus.MustRegister(leaseRevoked)
}

func monitorFileDescriptor(done <-chan struct{}) {
Expand Down
1 change: 1 addition & 0 deletions etcdserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,7 @@ func (s *EtcdServer) run() {
s.goAttach(func() {
ctx := s.authStore.WithRoot(s.ctx)
s.LeaseRevoke(ctx, &pb.LeaseRevokeRequest{ID: int64(lid)})
leaseRevoked.Inc()
<-c
})
}
Expand Down

0 comments on commit 6df9c4a

Please sign in to comment.