gRPC health check configuration

Hey everyone,

I have a gRPC service running on Fly and want to implement a proper health check. I’ve already implemented the official gRPC Health Checking Protocol ( Health Checking | gRPC ) in my app and added the grpc_health_probe ( GitHub - grpc-ecosystem/grpc-health-probe: A command-line tool to perform health-checks for gRPC applications in Kubernetes and elsewhere ) binary to my Dockerfile.

I initially tried using [[services.machine_checks]] to run the probe (doesn’t work because localhost is wrong):

toml

[[services.machine_checks]]
  command = ["/bin/grpc_health_probe", "-addr=localhost:50051"]
  interval = "10s"
  timeout = "2s"
  grace_period = "30s"

However, as I understand it, machine_checks are primarily for pre-deployment/canary testing and don’t seem to provide continuous runtime health signals for the proxy to pull unhealthy machines out of rotation.

My question:

  1. Is there a way to run a custom binary like grpc_health_probe as a standard runtime check (similar to Kubernetes exec probes)?

  2. If not, what is the recommended pattern to run health checks for gRPC services?

Greetings, Kalle!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.