-
Notifications
You must be signed in to change notification settings - Fork 997
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(health): Add tonic-health server impl #304
Conversation
0fc9ea1
to
fd59c97
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! I think the only thing left is to add a feature flag for the transport so this can be used without that feature flag. Otherwise, I'll ship this with tonic 0.2.
c4f3eb9
to
d6a7e07
Compare
This commit adds a new crate `tonic-health` which implements the [standard GRPC Health Checking][checking] protocol. Currently there is only a server implementation, though others have alluded in the discussion in #135 that client implementations exist which could also be imported as necessary. A example server has also been added - once the client work is done a client for this should be added also. [checking]: https://github.com/grpc/grpc/blob/master/doc/health-checking.md
d6a7e07
to
8674155
Compare
I think we should address a client here in a separate PR, so this looks ready for re-review (at least the added tests) - everything else has been addressed. |
@jen20 merge when you're ready! |
Thanks for reviewing @LucioFranco! |
Is the tonic-health checking expected to be working right now because using the example provided only results in For reference I used the example
This all compiled and connected successfully returning the error stated above. Am I using this incorrectly or do you have any idea on how to fix this? I've even printed out the service name as used by the tonic-health crate |
Hmm, that's curious - it is indeed expected to be working! I'll take a look and see if I can reproduce this... |
I've just tried this on the current $ cargo run --bin health-server
Compiling examples v0.1.0 (/Users/James/Code/rust/tonic/examples)
Finished dev [unoptimized + debuginfo] target(s) in 4.89s
Running `/Users/James/Code/rust/tonic/target/debug/health-server`
HealthServer + GreeterServer listening on [::1]:50057 $ grpcurl -plaintext \
-proto=/Users/James/Code/rust/tonic/tonic-health/proto/health.proto \
-import-path=/Users/James/Code/rust/tonic/tonic-health/proto \
-format=json \
-d='{"service": "helloworld.Greeter"}' \
'[::1]:50057' \
grpc.health.v1.Health.Check
{
"status": "SERVING"
} If I try a If you have |
This commit adds a new crate
tonic-health
which implements the standard GRPC Health Checking protocol, as per #135.Currently there is only a server implementation, though others have alluded in the discussion in #135 that client implementations exist which could also be imported as necessary.
A example server has also been added - once the client work is done a client for this should be added also.
Some further work that needs doing:
tokio::spawn
in implementation ofWatch
Cargo.toml
metadatatransport
feature which unlocks the various methods which useNamedService
Check
andWatch