Skip to content

Commit

Permalink
Merge pull request #10032 from gyuho/init-metrics-3.2
Browse files Browse the repository at this point in the history
etcdserver/api/v3rpc: display all registered gRPC metrics at start (v3.2)
  • Loading branch information
xiang90 committed Aug 25, 2018
2 parents 73b1a2b + 4928558 commit b3fa36e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions etcdserver/api/v3rpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import (

"github.com/coreos/etcd/etcdserver"
pb "github.com/coreos/etcd/etcdserver/etcdserverpb"

"github.com/grpc-ecosystem/go-grpc-prometheus"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/grpclog"
Expand Down Expand Up @@ -67,5 +69,9 @@ func Server(s *etcdserver.EtcdServer, tls *tls.Config, gopts ...grpc.ServerOptio
grpclog.SetLoggerV2(grpclog.NewLoggerV2(ioutil.Discard, os.Stderr, os.Stderr))
}
})

// to display all registered metrics with zero values
grpc_prometheus.Register(grpcServer)

return grpcServer
}

0 comments on commit b3fa36e

Please sign in to comment.