Register grpc metrics in main

This needs to be registered last after all other services have been
registred.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-06-14 11:19:58 -07:00
parent 9b8e76edf1
commit c2dd40c9bc
3 changed files with 2 additions and 27 deletions

View File

@@ -1,26 +0,0 @@
package metrics
import (
"github.com/containerd/containerd/plugin"
grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
"google.golang.org/grpc"
)
func init() {
plugin.Register("metrics-grpc", &plugin.Registration{
Type: plugin.GRPCPlugin,
Init: New,
})
}
func New(_ *plugin.InitContext) (interface{}, error) {
return &Service{}, nil
}
type Service struct {
}
func (s *Service) Register(server *grpc.Server) error {
grpc_prometheus.Register(server)
return nil
}