Skip to content

xds: LRS custom metrics changes (a85)#9005

Merged
mbissa merged 12 commits into
grpc:masterfrom
mbissa:a85-lrs-custom-metrics-changes
Apr 2, 2026
Merged

xds: LRS custom metrics changes (a85)#9005
mbissa merged 12 commits into
grpc:masterfrom
mbissa:a85-lrs-custom-metrics-changes

Conversation

@mbissa

@mbissa mbissa commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Addresses A85. Implements changes for LRS custom metrics.
RELEASE NOTES:

  • xds: Add changes for LRS custom metrics (A85)

@mbissa mbissa added this to the 1.81 Release milestone Mar 24, 2026
@mbissa mbissa self-assigned this Mar 24, 2026
@mbissa mbissa added the Type: Feature New features or improvements in behavior label Mar 24, 2026
@codecov

codecov Bot commented Mar 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.62887% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.06%. Comparing base (12e91dd) to head (8248d79).
⚠️ Report is 19 commits behind head on master.

Files with missing lines Patch % Lines
internal/xds/balancer/clusterimpl/picker.go 60.00% 3 Missing and 3 partials ⚠️
internal/xds/xdsclient/xdsresource/type_cds.go 64.70% 3 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9005      +/-   ##
==========================================
+ Coverage   83.04%   83.06%   +0.01%     
==========================================
  Files         411      413       +2     
  Lines       32892    33135     +243     
==========================================
+ Hits        27316    27524     +208     
- Misses       4181     4201      +20     
- Partials     1395     1410      +15     
Files with missing lines Coverage Δ
internal/xds/balancer/clusterimpl/clusterimpl.go 86.59% <100.00%> (-1.23%) ⬇️
internal/xds/clients/lrsclient/lrs_stream.go 72.51% <100.00%> (+4.70%) ⬆️
...nternal/xds/xdsclient/xdsresource/unmarshal_cds.go 89.33% <100.00%> (+0.63%) ⬆️
internal/xds/balancer/clusterimpl/picker.go 91.57% <60.00%> (-3.55%) ⬇️
internal/xds/xdsclient/xdsresource/type_cds.go 51.02% <64.70%> (+7.27%) ⬆️

... and 45 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mbissa mbissa requested review from eshitachandwani and removed request for eshitachandwani March 24, 2026 03:16
@mbissa mbissa force-pushed the a85-lrs-custom-metrics-changes branch from 9173e18 to 8822c92 Compare March 24, 2026 08:06
@mbissa mbissa force-pushed the a85-lrs-custom-metrics-changes branch from 8822c92 to 7c192be Compare March 24, 2026 10:29
@mbissa

mbissa commented Mar 24, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements the changes for LRS custom metrics as described in gRPC proposal A85. The changes are comprehensive, touching upon configuration parsing, balancer logic, picker implementation, and the LRS client itself to support propagating new ORCA metric types. The addition of an environment variable to gate this experimental feature is appropriate. The new functionality is also well-covered by unit and end-to-end tests.

The implementation looks solid. I have one minor suggestion regarding spec compliance when parsing lrs_report_endpoint_metrics.

Comment thread internal/xds/xdsclient/xdsresource/unmarshal_cds.go Outdated
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@mbissa mbissa requested a review from eshitachandwani March 24, 2026 11:11
Comment thread internal/envconfig/xds.go Outdated
Comment thread internal/xds/balancer/clusterimpl/tests/balancer_test.go Outdated
Comment thread internal/xds/xdsclient/xdsresource/unmarshal_cds.go
Comment thread internal/xds/xdsclient/xdsresource/type_cds.go Outdated
Comment thread internal/xds/xdsclient/xdsresource/tests/unmarshal_cds_test.go Outdated
Comment thread internal/xds/balancer/clusterimpl/picker.go Outdated
Comment thread internal/xds/balancer/clusterimpl/tests/balancer_test.go Outdated
Comment thread internal/xds/balancer/clusterimpl/tests/balancer_test.go Outdated
Comment thread internal/xds/balancer/clusterimpl/tests/balancer_test.go Outdated
Comment thread internal/xds/balancer/clusterimpl/picker.go
mbissa and others added 2 commits March 25, 2026 14:37
Co-authored-by: eshitachandwani <59800922+eshitachandwani@users.noreply.github.com>
@mbissa mbissa removed the request for review from easwars March 25, 2026 11:57
@mbissa mbissa assigned eshitachandwani and unassigned mbissa Mar 25, 2026
Comment thread internal/xds/balancer/clusterimpl/tests/balancer_test.go Outdated
Comment thread internal/xds/balancer/clusterimpl/tests/balancer_test.go Outdated
Comment thread internal/xds/balancer/clusterimpl/clusterimpl.go
Comment thread internal/xds/clients/lrsclient/lrs_stream.go Outdated
Comment thread internal/xds/xdsclient/xdsresource/tests/unmarshal_cds_test.go Outdated
@mbissa mbissa assigned eshitachandwani and unassigned mbissa Mar 26, 2026

@eshitachandwani eshitachandwani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with minor comments.

Comment thread internal/xds/balancer/clusterimpl/tests/balancer_test.go Outdated
Comment thread internal/xds/clients/lrsclient/lrs_stream.go Outdated
Comment thread internal/xds/xdsclient/xdsresource/tests/unmarshal_cds_test.go Outdated
Comment thread internal/xds/xdsclient/xdsresource/tests/unmarshal_cds_test.go Outdated
@mbissa mbissa assigned mbissa and unassigned eshitachandwani Mar 27, 2026
@mbissa mbissa requested a review from easwars March 27, 2026 11:03
@mbissa mbissa assigned easwars and unassigned mbissa Mar 27, 2026
Comment thread internal/xds/xdsclient/xdsresource/type_cds.go Outdated
Comment thread internal/xds/xdsclient/xdsresource/type_cds.go Outdated
Comment thread internal/xds/xdsclient/xdsresource/type_cds.go Outdated
Comment thread internal/xds/xdsclient/xdsresource/type_cds.go Outdated
Comment thread internal/xds/xdsclient/xdsresource/unmarshal_cds.go Outdated
Comment thread internal/xds/balancer/clusterimpl/clusterimpl.go Outdated
Comment thread internal/xds/balancer/clusterimpl/picker.go
Comment thread internal/xds/clients/lrsclient/lrs_stream.go Outdated
Comment thread internal/xds/balancer/clusterimpl/tests/balancer_test.go Outdated
Comment thread internal/xds/balancer/clusterimpl/tests/balancer_test.go Outdated
@easwars easwars assigned mbissa and unassigned easwars Mar 31, 2026
@mbissa mbissa force-pushed the a85-lrs-custom-metrics-changes branch from dd2c42a to 5b5b6da Compare March 31, 2026 20:02
@mbissa mbissa assigned easwars and unassigned mbissa Mar 31, 2026

@easwars easwars left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, modulo some outstanding comments.

The most important one of them was moving the newly added test TestValidateCluster_LRSReportEndpointMetrics to the other unmarshal_cds_test.go which is in the same package as the code (and therefore not having to use an variable that is defined only to be overridden by a test in another package).

Comment thread internal/xds/balancer/clusterimpl/picker.go
Comment thread internal/xds/balancer/clusterimpl/tests/balancer_test.go Outdated
Comment thread internal/xds/xdsclient/xdsresource/tests/unmarshal_cds_test.go
Comment thread internal/xds/xdsclient/xdsresource/type_cds.go Outdated
Comment thread internal/xds/xdsclient/xdsresource/type_cds.go Outdated
@easwars easwars assigned mbissa and unassigned easwars Mar 31, 2026
@mbissa mbissa assigned easwars and unassigned mbissa Apr 1, 2026
// update with the one currently used by picker, and is protected by b.mu. It
// returns a boolean indicating if a new picker needs to be generated.
func (b *clusterImplBalancer) handleDropAndRequestCountLocked(clusterConfig xdsresource.ClusterConfig) bool {
// handleClusterConfigLocked compares internal state with the new cluster

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized that the old docstring was outdated too, in the sense that it does more than just compare the old and the new. Its updates the internal state as well. Could you please update the docstring to reflect reality. Thanks.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@easwars easwars assigned mbissa and unassigned easwars Apr 2, 2026
@mbissa mbissa merged commit 2143802 into grpc:master Apr 2, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Feature New features or improvements in behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants