-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
Add health checks to Node.js services #26
Conversation
src/currencyservice/.gitignore
Outdated
@@ -1 +1,2 @@ | |||
proto/ |
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.
You should probably undo this.
We want the app to be buildable from source just after git-clone, so we should keep the duplicate protos –it's fine for now (until/if we decide to use Bazel).
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.
Done.
pb/demo.proto
Outdated
@@ -156,6 +157,7 @@ message CurrencyConversionRequest { | |||
|
|||
service PaymentService { | |||
rpc Charge(ChargeRequest) returns (ChargeResponse) {} | |||
rpc Check(Empty) returns (Empty) {} |
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.
This would come from the standard gRPC HC protocol: https://github.com/grpc/grpc/blob/master/src/proto/grpc/health/v1/health.proto
Also: https://github.com/grpc/grpc/blob/master/doc/health-checking.md
So we need to implement the grpc.health.v1.Health
's rpc Check
instead. This would
- download health.proto to pb/
- update genproto scripts for node
- register for Health service in app
- implement rpc Check(HealthCheckRequest) returns (HealthCheckResponse); from the health.proto
this gets currencyservice to work but paymentservice is still crashing in the docker container. Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
I pushed a commit that fixes genproto.sh path issue in these services + ran the scripts.
|
This works fine now. |
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
* Move Node healthchecks to gRPC * gitignore proto files * Switch to standard health RPC * Fix lint * Update client.js * Add protos back + update them * node services: fix & run genproto.sh this gets currencyservice to work but paymentservice is still crashing in the docker container. Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com> * Fix docker breaking * update dockerfiles with released health probe Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
FYI: I've tested these locally, but not with Docker.