diff --git a/cmd/signal/allrpc/server/server.go b/cmd/signal/allrpc/server/server.go index 4a7deb721..ade3b058d 100644 --- a/cmd/signal/allrpc/server/server.go +++ b/cmd/signal/allrpc/server/server.go @@ -14,6 +14,8 @@ import ( "github.com/pion/ion-sfu/pkg/sfu" "github.com/prometheus/client_golang/prometheus/promhttp" "google.golang.org/grpc" + "google.golang.org/grpc/health" + "google.golang.org/grpc/health/grpc_health_v1" // pprof _ "net/http/pprof" @@ -51,6 +53,7 @@ func (s *Server) ServeGRPC(gaddr string) error { grpc.StreamInterceptor(grpc_prometheus.StreamServerInterceptor), ) pb.RegisterSFUServer(gs, grpcServer.NewServer(s.sfu)) + grpc_health_v1.RegisterHealthServer(gs, health.NewServer()) s.logger.Info("GRPC Listening", "addr", gaddr) if err := gs.Serve(l); err != nil { diff --git a/cmd/signal/grpc/main.go b/cmd/signal/grpc/main.go index 3d1bb7518..6536bab5b 100644 --- a/cmd/signal/grpc/main.go +++ b/cmd/signal/grpc/main.go @@ -19,6 +19,8 @@ import ( "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/spf13/viper" "google.golang.org/grpc" + "google.golang.org/grpc/health" + "google.golang.org/grpc/health/grpc_health_v1" ) type grpcConfig struct { @@ -188,6 +190,7 @@ func main() { dc.Use(datachannel.SubscriberAPI) pb.RegisterSFUServer(s, server.NewServer(nsfu)) + grpc_health_v1.RegisterHealthServer(s, health.NewServer()) grpc_prometheus.Register(s) go startMetrics(metricsAddr)