Set of examples that show off the features provided by rama-grpc.
cargo run -p rama-grpc-examples --bin helloworld-clientcargo run -p rama-grpc-examples --bin helloworld-servergRPC has a health checking protocol that defines how health checks for services should be carried out. rama-grpc supports
it out of the box as long as you have the protobuf feature enabled (a default feature).
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.
For example, run the health server example (which toggles the serve status of the hello world example server every 250ms`):
cargo run -p rama-grpc-examples --bin health-serverAnd then run the go probe client (ensure to install it first):
while [ true ]; do
$HOME/go/bin/grpc-health-probe -addr='[::1]:50051' -service='helloworld.Greeter'
sleep '0.25'
donewill show the change in health status of the service over time:
service unhealthy (responded with "NOT_SERVING")
status: SERVING
service unhealthy (responded with "NOT_SERVING")
status: SERVING
...
Demonstrates exporting OpenTelemetry metrics over gRPC using the OTLP protocol.
Requires a running OpenTelemetry collector:
docker run -p 127.0.0.1:4317:4317 otel/opentelemetry-collector:latestThen run:
cargo run -p rama-grpc-examples --features opentelemetry --bin otel-exporter