Skip to content

Commit

Permalink
grpc health check protocol support
Browse files Browse the repository at this point in the history
  • Loading branch information
millken authored and dustinxie committed Oct 19, 2021
1 parent 6936aa5 commit 13f7452
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import (
"google.golang.org/genproto/googleapis/rpc/errdetails"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/health"
"google.golang.org/grpc/health/grpc_health_v1"
"google.golang.org/grpc/reflection"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
Expand Down Expand Up @@ -187,6 +189,9 @@ func NewServer(
otelgrpc.UnaryServerInterceptor(),
)),
)
//serviceName: grpc.health.v1.Health
grpc_health_v1.RegisterHealthServer(svr.grpcServer, health.NewServer())

iotexapi.RegisterAPIServiceServer(svr.grpcServer, svr)
grpc_prometheus.Register(svr.grpcServer)
reflection.Register(svr.grpcServer)
Expand Down

0 comments on commit 13f7452

Please sign in to comment.