Skip to content

Commit

Permalink
xds: Rename grpc.xds.cluster to grpc.lb.backend_service
Browse files Browse the repository at this point in the history
The name is being changed to allow the value to be used in more metrics
where xds-specifics are awkward.
  • Loading branch information
ejona86 committed Jan 18, 2025
1 parent 7dada7d commit 4412054
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion xds/src/main/java/io/grpc/xds/ClusterImplLoadBalancer.java
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ private RequestLimitingSubchannelPicker(SubchannelPicker delegate,
public PickResult pickSubchannel(PickSubchannelArgs args) {
args.getCallOptions().getOption(ClusterImplLoadBalancerProvider.FILTER_METADATA_CONSUMER)
.accept(filterMetadata);
args.getPickDetailsConsumer().addOptionalLabel("grpc.xds.cluster", cluster);
args.getPickDetailsConsumer().addOptionalLabel("grpc.lb.backend_service", cluster);
for (DropOverload dropOverload : dropPolicies) {
int rand = random.nextInt(1_000_000);
if (rand < dropOverload.dropsPerMillion()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ public void pick_addsOptionalLabels() {
// The value will be determined by the parent policy, so can be different than the value used in
// makeAddress() for the test.
verify(detailsConsumer).addOptionalLabel("grpc.lb.locality", locality.toString());
verify(detailsConsumer).addOptionalLabel("grpc.xds.cluster", CLUSTER);
verify(detailsConsumer).addOptionalLabel("grpc.lb.backend_service", CLUSTER);
}

@Test
Expand All @@ -322,7 +322,7 @@ public void pick_noResult_addsClusterLabel() {
TestMethodDescriptors.voidMethod(), new Metadata(), CallOptions.DEFAULT, detailsConsumer);
PickResult result = currentPicker.pickSubchannel(pickSubchannelArgs);
assertThat(result.getStatus().isOk()).isTrue();
verify(detailsConsumer).addOptionalLabel("grpc.xds.cluster", CLUSTER);
verify(detailsConsumer).addOptionalLabel("grpc.lb.backend_service", CLUSTER);
}

@Test
Expand Down

0 comments on commit 4412054

Please sign in to comment.