[xds] Implement A114: WRR support for custom backend metrics#12645
[xds] Implement A114: WRR support for custom backend metrics#12645sauravzg wants to merge 5 commits intogrpc:masterfrom
Conversation
418bd90 to
d76e770
Compare
|
cc: @danielzhaotongliu To TAL at the PR. |
xds/src/main/java/io/grpc/xds/WeightedRoundRobinLoadBalancer.java
Outdated
Show resolved
Hide resolved
xds/src/main/java/io/grpc/xds/WeightedRoundRobinLoadBalancer.java
Outdated
Show resolved
Hide resolved
xds/src/main/java/io/grpc/xds/WeightedRoundRobinLoadBalancerProvider.java
Outdated
Show resolved
Hide resolved
785c5f9 to
63c5bf3
Compare
xds/src/main/java/io/grpc/xds/WeightedRoundRobinLoadBalancer.java
Outdated
Show resolved
Hide resolved
xds/src/test/java/io/grpc/xds/WeightedRoundRobinLoadBalancerProviderTest.java
Show resolved
Hide resolved
xds/src/test/java/io/grpc/xds/WeightedRoundRobinLoadBalancerTest.java
Outdated
Show resolved
Hide resolved
xds/src/test/java/io/grpc/xds/WeightedRoundRobinLoadBalancerTest.java
Outdated
Show resolved
Hide resolved
xds/src/test/java/io/grpc/xds/internal/MetricReportUtilsTest.java
Outdated
Show resolved
Hide resolved
Updates the Weighted Round Robin (WRR) load balancing policy to support customizable utilization metrics via the `metric_names_for_computing_utilization` configuration. This allows endpoint weights to be driven by arbitrary named metrics (e.g. `named_metrics.foo`) or other standard metrics (e.g. `memory_utilization`) instead of solely `application_utilization` or the `cpu_utilization` fallback. Refactors metric resolution logic into `io.grpc.xds.internal.MetricReportUtils` to handle the new map lookup and validation requirements.
7117abe to
378ef63
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces support for custom metrics in the Weighted Round Robin (WRR) load balancer. It adds a new configuration field, metricNamesForComputingUtilization, which allows users to specify a list of metrics for calculating backend utilization. The implementation includes a new utility class, MetricReportUtils, to resolve these metrics from ORCA load reports. The utilization calculation logic has been updated to prioritize the maximum value of specified custom metrics, falling back to application utilization and then CPU utilization if custom metrics are unavailable or invalid. This feature is currently guarded by the GRPC_EXPERIMENTAL_WRR_CUSTOM_METRICS experimental flag. I have no feedback to provide as there are no review comments.
Description
This PR implements gRFC A114: WRR Support for Custom Backend Metrics.
It updates the
weighted_round_robinpolicy to allow users to configure which backend metrics drive the load balancing weights.Key Changes
metric_names_for_computing_utilizationfield inWeightedRoundRobinLbConfig.named_metrics.foo) whenapplication_utilizationis absent.MetricReportUtils.application_utilization>custom_metrics(max valid value) >cpu_utilization.