-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Add List method to gRPC Health service #8155
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
base: master
Are you sure you want to change the base?
Conversation
This change introduces a new `List` RPC endpoint 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. Proposal: grpc/proposal#468 gRPC-proto change: grpc/grpc-proto#143 Signed-off-by: Marcos Huck <[email protected]>
health/grpc_health_v1/health.pb.go
Outdated
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.
I regenerated the Go stubs using the work in progress version of grpc/grpc-proto#143
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.
I regenerated the Go stubs using the work in progress version of grpc/grpc-proto#143
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #8155 +/- ##
==========================================
- Coverage 82.09% 82.02% -0.07%
==========================================
Files 412 412
Lines 40491 40503 +12
==========================================
- Hits 33242 33224 -18
- Misses 5876 5896 +20
- Partials 1373 1383 +10
🚀 New features to boost your workflow:
|
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.
@marcoshuck i think we need to wait for the proposal and proto change to be merged before this? I still see them in review
@dfawley cc
Signed-off-by: Marcos Huck <[email protected]>
This PR is labeled as requiring an update from the reporter, and no update has been received after 6 days. If no update is provided in the next 7 days, this issue will be automatically closed. |
Signed-off-by: Marcos Huck <[email protected]>
Co-authored-by: Purnesh Dixit <[email protected]>
Signed-off-by: Marcos Huck <[email protected]>
@marcoshuck could you resolve the merge conflicts? |
health/server_internal_test.go
Outdated
} | ||
} | ||
|
||
// TestListResourceExhausted verifies that the service status list returns an error when it exceeds |
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.
nit: restrict the comments to 80 cols
Signed-off-by: Marcos Huck <[email protected]>
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.
lgtm. Please wrap comments under 80 cols per line.
@@ -30,6 +30,12 @@ import ( | |||
"google.golang.org/grpc/status" | |||
) | |||
|
|||
const ( | |||
// maxAllowedServices defines the maximum number of resources a List operation can return. |
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.
nit: wrap comments to 80 cols per line.
if len(out.GetStatuses()) != len(s.statusMap) { | ||
t.Fatalf("len(out.GetStatuses()) = %d, want %d", len(out.GetStatuses()), len(s.statusMap)) | ||
} | ||
for key := range out.GetStatuses() { |
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.
nit: for k, v := range out.GetStatuses()
then don't need line 115
t.Fatalf("s.List(ctx, &in) return nil error, want non-nil") | ||
} | ||
if !errors.Is(err, status.Errorf(codes.ResourceExhausted, "server health list exceeds maximum capacity: %d", maxAllowedServices)) { | ||
t.Fatal("List should have failed with resource exhausted") |
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.
t.Fatal("List should have failed with resource exhausted") | |
t.Fatal("s.List() = %v, want %v, err, status.Errorf(codes.ResourceExhausted, "server health list exceeds maximum capacity: %d", maxAllowedServices)") |
Could you run |
This change introduces a new
List
RPC endpoint 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.Proposal: grpc/proposal#468
gRPC-proto change: grpc/grpc-proto#143