Below you will find pages that utilize the taxonomy term “Healthcheck”
Posts
read more
gRPC Healthchecking in Rust
Golang
Go provides an implementation gprc_health_v1 of the gRPC Health-checking Protocol proto.
This is easily implemented:
package main
import (
pb "github.com/DazWilkin/.../protos"
"google.golang.org/grpc"
"google.golang.org/grpc/health"
healthpb "google.golang.org/grpc/health/grpc_health_v1"
)
func main() {
...
serverOpts := []grpc.ServerOption{}
grpcServer := grpc.NewServer(serverOpts...)
// Register the pb service
pb.RegisterSomeServer(grpcServer, NewServer())
// Register the healthpb service
healthpb.RegisterHealthServer(grpcServer, health.NewServer())
listen, err := net.Listen("tcp", *grpcEndpoint)
if err != nil {
log.Fatal(err)
}
log.Printf("[main] Starting gRPC Listener [%s]\n", *grpcEndpoint)
log.Fatal(grpcServer.Serve(listen))
}
Because it’s gRPC, you need an implementation of the proto for the client, one is provided too grpc-health-probe: