-
Notifications
You must be signed in to change notification settings - Fork 250
A90: Add List Method to gRPC Health Service #468
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
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
87393ab
Add List endpoint to gRPC Health service
marcoshuck e0f503e
Apply suggestions from code review
marcoshuck 31c0d8a
Address comments from PR
marcoshuck 4b07307
Update status and last updated date
marcoshuck 1ed8f0d
Address comments from PR
marcoshuck be0e369
Remove # from title
marcoshuck 7b00440
Add link to existing health service proto specification
marcoshuck dc0399f
Add A17 proposal as a related proposal
marcoshuck a71e91d
Add comment about maximum number of services to return in the response
marcoshuck ca7a321
Mention that the list of services can change over the lifetime of a p…
marcoshuck 4599f01
Remove service list filter in the HealthListRequest
marcoshuck 483492d
Update status to Final due to approval in PR
marcoshuck ca0b136
Update A90-health-service-list-method.md
markdroth 914ca07
Remove language list
marcoshuck 2b10e29
Simplify proposal reference to use relative link
marcoshuck 6a83c2c
Set last updated date
marcoshuck 1a9f1f2
Reformat markdown
marcoshuck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| A90: Add List Method to gRPC Health Service | ||
| ---- | ||
|
|
||
| * **Author(s):** @marcoshuck | ||
| * **Approver:** @markdroth | ||
| * **Status:** Final | ||
| * **Implemented in:** - | ||
| * **Last updated:** 2025-03-10 | ||
| * **Discussion at:** https://groups.google.com/g/grpc-io/c/tEI5G9sX0zc | ||
|
|
||
| ## Abstract | ||
|
|
||
| This proposal introduces a new `List` RPC method for the Health service, allowing clients to retrieve the statuses of | ||
| all monitored services. This feature simplifies integration with status-reporting dashboards and enhances observability | ||
| for microservices. | ||
|
|
||
| ## Background | ||
|
|
||
| The [existing Health service](https://github.com/grpc/grpc-proto/blob/cbb231341938471b78b38729c2e4a712a9e098d0/grpc/health/v1/health.proto) | ||
| provides basic health check functionality but lacks a mechanism to retrieve a comprehensive list of all monitored | ||
| services and their statuses. | ||
|
|
||
| This limitation makes it challenging for clients to aggregate health information across multiple services, particularly | ||
| for use cases like publishing service statuses to dashboards such as [Cachet](https://cachethq.io/) | ||
| or [Statuspage](https://www.atlassian.com/software/statuspage). | ||
|
|
||
| It's important to keep in mind that the list of health services exposed by an application can change over the lifetime | ||
| of the process. | ||
|
|
||
| Kubernetes provides a similar capability with its `/readyz?verbose` endpoint, which lists the status of all components. | ||
| This proposal aims to bring analogous functionality to the Health service, providing a unified view of service health. | ||
|
|
||
| ### Related Proposals | ||
|
|
||
| - [A17 - Client-Side Health Checking](A17-client-side-health-checking.md) | ||
|
|
||
| ## Proposal | ||
|
|
||
| Introduce a new `List` RPC method in the Health service with the following features: | ||
|
|
||
| - Retrieve the health statuses of all monitored services. | ||
| - Ensure the implementation is idempotent and side-effect free. | ||
| - Provide a clear schema for the request and response to facilitate integration with external tools. | ||
|
|
||
| ### Proposed API Changes | ||
|
|
||
| ```protobuf | ||
| message HealthListRequest { | ||
| } | ||
|
|
||
| message HealthListResponse { | ||
| map<string, HealthCheckResponse> statuses = 1; // Contains all the services and their respective status. | ||
dfawley marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
|
|
||
| service Health { | ||
| // List provides a non-atomic snapshot of the health of all the available services. | ||
| // | ||
| // The maximum number of services to return is 100; responses exceeding this limit will result in a RESOURCE_EXHAUSTED | ||
| // error. | ||
| // | ||
| // Clients should set a deadline when calling List, and can declare the | ||
| // server unhealthy if they do not receive a timely response. | ||
| // | ||
| // Clients should keep in mind that the list of health services exposed by an application | ||
| // can change over the lifetime of the process. | ||
| // | ||
| // List implementations should be idempotent and side effect free. | ||
| rpc List(HealthListRequest) returns (HealthListResponse); | ||
marcoshuck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| ``` | ||
|
|
||
| ### Temporary environment variable protection | ||
|
|
||
| N/A | ||
|
|
||
| ## Rationale | ||
|
|
||
| Adding the List RPC method to the Health service strikes a balance between functionality and simplicity. | ||
|
|
||
| ### Alternative approaches | ||
|
|
||
| - Separate Service: Extract the new functionality into a standalone service. This avoids altering the existing Health | ||
| service API but increases complexity by introducing another service for clients to interact with. | ||
|
|
||
| ## Implementation | ||
|
|
||
| 1. Add the `List` RPC method and the associated request/response messages in the Health service `.proto` file. | ||
| 2. Implement `List` RPC method in the respective gRPC languages. | ||
| 3. Update client libraries to support the `List` method. Provide examples demonstrating how to call the method and | ||
| handle its response. | ||
| 4. Update API documentation to describe the new method, its use cases, and sample requests/responses. | ||
|
|
||
| ## Open issues (if applicable) | ||
|
|
||
| N/A | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.