2017-03-14 23:16:49 +00:00
|
|
|
package metrics
|
|
|
|
|
|
|
|
import (
|
2017-04-03 20:14:15 +00:00
|
|
|
"github.com/containerd/containerd/plugin"
|
2017-03-14 23:16:49 +00:00
|
|
|
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
|
|
|
|
}
|