Skip to content

Commit 2eb777a

Browse files
Add List method to gRPC Health service (#143)
* Add List method to Health service * Apply suggestions from code review Co-authored-by: Benjamin Krämer <[email protected]> * Update List method with feedback from the proposal review process * Apply suggestions from code review Signed-off-by: Marcos Huck <[email protected]> * Soften warning about too many services Signed-off-by: Marcos Huck <[email protected]> --------- Signed-off-by: Marcos Huck <[email protected]> Co-authored-by: Benjamin Krämer <[email protected]>
1 parent cbb2313 commit 2eb777a

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

grpc/health/v1/health.proto

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ message HealthCheckResponse {
4040
ServingStatus status = 1;
4141
}
4242

43+
message HealthListRequest {}
44+
45+
message HealthListResponse {
46+
// statuses contains all the services and their respective status.
47+
map<string, HealthCheckResponse> statuses = 1;
48+
}
49+
4350
// Health is gRPC's mechanism for checking whether a server is able to handle
4451
// RPCs. Its semantics are documented in
4552
// https://github.com/grpc/grpc/blob/master/doc/health-checking.md.
@@ -51,10 +58,21 @@ service Health {
5158
//
5259
// Clients should set a deadline when calling Check, and can declare the
5360
// server unhealthy if they do not receive a timely response.
54-
//
55-
// Check implementations should be idempotent and side effect free.
5661
rpc Check(HealthCheckRequest) returns (HealthCheckResponse);
5762

63+
// List provides a non-atomic snapshot of the health of all the available
64+
// services.
65+
//
66+
// The server may respond with a RESOURCE_EXHAUSTED error if too many services
67+
// exist.
68+
//
69+
// Clients should set a deadline when calling List, and can declare the server
70+
// unhealthy if they do not receive a timely response.
71+
//
72+
// Clients should keep in mind that the list of health services exposed by an
73+
// application can change over the lifetime of the process.
74+
rpc List(HealthListRequest) returns (HealthListResponse);
75+
5876
// Performs a watch for the serving status of the requested service.
5977
// The server will immediately send back a message indicating the current
6078
// serving status. It will then subsequently send a new message whenever

0 commit comments

Comments
 (0)