Fix gRPC health checks and add API Gateway Consul registration
- Fix gRPC health checks: Set serving status for default service (empty string) in all services - Consul checks the default service by default, not specific service names - All services now set both default and specific service status to SERVING - Update Consul registration logic to automatically detect HTTP vs gRPC services - HTTP services (API Gateway) use HTTP health checks - gRPC services use gRPC health checks - Detection based on service tags and metadata - Add API Gateway Consul registration - Register with Docker service name in Docker environment - Use HTTP health checks for API Gateway - Proper host/port configuration handling - Add API Gateway HTTP-to-gRPC handlers - Implement service-specific handlers for Auth and Identity services - Translate HTTP requests to gRPC calls - Map gRPC error codes to HTTP status codes
This commit is contained in:
@@ -418,6 +418,9 @@ func provideIdentityService() fx.Option {
|
||||
// Register health service
|
||||
healthServer := health.NewServer()
|
||||
grpc_health_v1.RegisterHealthServer(grpcServer, healthServer)
|
||||
// Set serving status for the default service (empty string) - this is what Consul checks
|
||||
healthServer.SetServingStatus("", grpc_health_v1.HealthCheckResponse_SERVING)
|
||||
// Also set for the specific service name
|
||||
healthServer.SetServingStatus("identity.v1.IdentityService", grpc_health_v1.HealthCheckResponse_SERVING)
|
||||
|
||||
// Register reflection for grpcurl
|
||||
|
||||
Reference in New Issue
Block a user