The startup probe for my grpc spring boot microservice fails.
This is defined in my terraform file as follows
startup_probe = {
grpc = {
port = 9090
service = "grpc.health.v1.Health/Check"
}
}
grpcurl -plaintext localhost:9090 grpc.health.v1.Health/Check
{
“status”: “SERVING”
}
I expected the probe to pass and my application to no longer be red
As you can see from the logs below. The server starts correctly it is just the probe that fails
2024-09-25 22:25:56.164 CEST
22:25:56,164 [34mINFO [0;39m [main] [36mAbstractGrpcServerFactory[0;39m – Registered gRPC service: envoy.service.ext_proc.v3.ExternalProcessor, bean: externalProcessorService, class: net.payback.globalapi.requestprocessor.application.service.ExternalProcessorService
2024-09-25 22:25:56.164 CEST
22:25:56,164 [34mINFO [0;39m [main] [36mAbstractGrpcServerFactory[0;39m – Registered gRPC service: grpc.health.v1.Health, bean: grpcHealthService, class: io.grpc.protobuf.services.HealthServiceImpl
2024-09-25 22:25:56.164 CEST
22:25:56,165 [34mINFO [0;39m [main] [36mAbstractGrpcServerFactory[0;39m – Registered gRPC service: grpc.reflection.v1alpha.ServerReflection, bean: protoReflectionService, class: io.grpc.protobuf.services.ProtoReflectionService
2024-09-25 22:25:56.226 CEST
22:25:56,226 [34mINFO [0;39m [main] [36mGrpcServerLifecycle[0;39m – gRPC Server started, listening on address: *, port: 9090
Timothy Canavan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
The startup_probe
‘s grpc
‘s service
should be:
- either
""
for the health of the entire service; - or
"foo"
wherefoo
is the name of a registered service (see below).
When the Health Checking protocol is implemented against a gRPC service, the server should permit the registration of specific-service names (see the Golang google.golang.org/grpc/health
Server
‘s SetServingStatus
method).
The server should then maintain health states for both the entire service (""
) and each of the registered services (e.g. foo
).
grpc.health.v1.Health/Check
is the correct full method ({package}.{Service}/{Method}
) name of the Health Checking service as implemented by your gRPC service but this is implicit (need not be specified) in the grpc
probe which only needs an optional service
for the Health Checking request:
message HealthCheckRequest {
string service = 1;
}
The relevant text is:
The server should register all the services manually and set the individual status, including an empty service name and its status. For each request received, if the service name can be found in the registry, a response must be sent back with an OK status and the status field should be set to SERVING or NOT_SERVING accordingly. If the service name is not registered, the server returns a NOT_FOUND GRPC status.