Search code examples
dartgrpckubernetes-health-checkgrpc-dart

how implement health check in the grpc-dart implementation?


I am trying to add grpc health check to my dart backend, but it seems that the grpc implementation in dart does not bring the service for the kubernetes health check, as in other grpc implementations, as is the case of java https://grpc.github.io/grpc-java/javadoc/io/grpc/services/HealthStatusManager.html#getHealthService--.

how can i do this in dart ?


Solution

  • gRPC provides a health.proto, described here.

    Some of the language implementations provide implementations for it too. I know Go does grpc_health_v1 and it appears Java does too.

    The proto is straightforward and, if the Dart SDK doesn't include an implementation, it should be straightforward for you to create one.

    I recommend you retain the proto` package name mapped to Dart's package naming.