🔌 gRPC Intermediate

What is gRPC health checking?

Answer

gRPC health checking is a standardized protocol (grpc.health.v1) that allows load balancers, service meshes, and Kubernetes probes to check whether a gRPC server is ready to handle requests. The health check service provides a Check RPC that returns SERVING, NOT_SERVING, or UNKNOWN for a named service. Implementation in Go: healthServer := health.NewServer(); healthServer.SetServingStatus("", grpchealth.HealthCheckResponse_SERVING); grpc_health_v1.RegisterHealthServer(grpcServer, healthServer). Kubernetes configures gRPC liveness/readiness probes using the grpc probe type (K8s 1.24+): livenessProbe: grpc: { port: 50051 }. The health check can also support watching with the Watch streaming RPC, allowing load balancers to receive real-time status changes and immediately route traffic away from degraded instances.