Closed taeng0204 closed 1 month ago
The recent changes introduce a straightforward HTTP health check endpoint to the server, enhancing service observability. A new handler responds to GET requests, providing an accessible way for uptime checkers to monitor service health. This feature complements existing gRPC health checks, ensuring a versatile and user-friendly monitoring solution.
File(s) | Change Summary |
---|---|
server/rpc/health/health.go , server/rpc/httphealth/httphealth.go |
Introduced HTTP health check handlers and response structs for health status. |
server/rpc/server.go |
Refactored health check handling to improve code clarity and modularity. |
test/integration/health_test.go |
Renamed gRPC health check test and added new HTTP health check tests for comprehensive coverage. |
Objective | Addressed | Explanation |
---|---|---|
Add Plain HTTP Health Check Endpoint (#832) | β |
π° In the meadow, we hop with glee,
A health check now waits, as easy as can be!
With GET requests, our status is clear,
Uptime checkers smile, their worries disappear!
So bounce along, in code we trust,
For healthy servers, we must adjust! π±
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
@taeng0204 Could you please sign the CLA? Also you need to lint the code to pass the CI.
@krapie There are a lot of lint errors that are not related to the file I'm dealing with, so I didn't find it, sorry. ~For clean commits, I modified the pushed commits with amend and force since it's just me working on the branch, is that okay?~ I didn't realize you were using squash merge...!
My real email address and the email info in the commit didn't match, which is why the CLA wasn't working... I'm so sorryπ
@taeng0204 If you finish your work, please re-request review.
@krapie I've completed it to requirements. Thanks for your help. βΊοΈ Does Yorkie have any documentation or guidelines for writing test code?
@taeng0204 There are two things that I want to share:
/healthz/
again in cluster condition. In yorkie-cluster, envoy proxy uses the same path for their own health check. So we have to explicitly route to our own Yorkie service, or change the path to something like /yorkie.v1/healthz
.@krapie I've processed it in this branch and created a new PR as we talked about today. Please check it out π
Added a handler to allow health checks to be performed with plain HTTP GET requests, rather than health checks using rpc.
What this PR does / why we need it: In issue #832 , we needed a health check via HTTP GET or HEAD method because of NCP's load balancer. The existing grpchealth could not satisfy this, so we implemented a separate handler. This allows us to check the health of a specific service via the path
/healthz/
and the health of a specific service via the queryservice=<serviceName>
. Which issue(s) this PR fixes:Fixes #832
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation:
Checklist:
Summary by CodeRabbit
New Features
Bug Fixes
Tests