From 4b26e781099b267358c108a52ba11358e2fce6e7 Mon Sep 17 00:00:00 2001 From: "Juan J. Jimenez-Anca" Date: Sat, 1 May 2021 16:30:54 +0100 Subject: [PATCH] add docs for health checks (#599) --- examples/src/health/README.md | 16 ++++++++++++++++ tonic-health/README.md | 4 +++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 examples/src/health/README.md diff --git a/examples/src/health/README.md b/examples/src/health/README.md new file mode 100644 index 000000000..b3ac82b38 --- /dev/null +++ b/examples/src/health/README.md @@ -0,0 +1,16 @@ +# Health checks + +gRPC has a [health checking protocol](https://github.com/grpc/grpc/blob/master/doc/health-checking.md) that defines how health checks for services should be carried out. Tonic supports this protocol with the optional [tonic health crate](https://docs.rs/tonic-health). + +This example uses the crate to set up a HealthServer that will run alongside the application service. In order to test it, you may use community tools like [grpc_health_probe](https://github.com/grpc-ecosystem/grpc-health-probe). + +For example, running the following bash script: + +```bash +while [ true ]; do +./grpc_health_probe -addr=[::1]:50051 -service=helloworld.Greeter +sleep 1 +done +``` + +will show the change in health status of the service over time. \ No newline at end of file diff --git a/tonic-health/README.md b/tonic-health/README.md index 616d8f167..7e8112938 100644 --- a/tonic-health/README.md +++ b/tonic-health/README.md @@ -1,6 +1,8 @@ # tonic-health -A `tonic` based gRPC healthcheck implementation. +A `tonic` based gRPC healthcheck implementation. It closely follows the official [health checking protocol](https://github.com/grpc/grpc/blob/master/doc/health-checking.md), although it may not implement all features described in the specs. + +Please follow the example in the [main repo](https://github.com/hyperium/tonic/tree/master/examples/src/health) to see how it works. ## Features