Skip to content
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

xds: Remove xds authority label from metric registration #11760

Merged
merged 2 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ final class XdsClientMetricReporterImpl implements XdsClientMetricReporter {
Arrays.asList("grpc.target", "grpc.xds.server"), Collections.emptyList(), false);
RESOURCES_GAUGE = metricInstrumentRegistry.registerLongGauge("grpc.xds_client.resources",
"EXPERIMENTAL. Number of xDS resources.", "{resource}",
Arrays.asList("grpc.target", "grpc.xds.authority", "grpc.xds.cache_state",
Arrays.asList("grpc.target", "grpc.xds.cache_state",
"grpc.xds.resource_type"), Collections.emptyList(), false);
}

Expand Down
15 changes: 11 additions & 4 deletions xds/src/test/java/io/grpc/xds/XdsClientMetricReporterImplTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package io.grpc.xds;

import static com.google.common.truth.Truth.assertThat;
import static org.mockito.AdditionalAnswers.delegatesTo;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.argThat;
import static org.mockito.ArgumentMatchers.eq;
Expand Down Expand Up @@ -82,14 +83,14 @@ public class XdsClientMetricReporterImplTest {
@Rule
public final MockitoRule mocks = MockitoJUnit.rule();

@Mock
private MetricRecorder mockMetricRecorder;
@Mock
private XdsClient mockXdsClient;
@Mock
private BatchRecorder mockBatchRecorder;
@Captor
private ArgumentCaptor<BatchCallback> gaugeBatchCallbackCaptor;
private MetricRecorder mockMetricRecorder = mock(MetricRecorder.class,
delegatesTo(new MetricRecorderImpl()));
private BatchRecorder mockBatchRecorder = mock(BatchRecorder.class,
delegatesTo(new BatchRecorderImpl()));

private XdsClientMetricReporterImpl reporter;

Expand Down Expand Up @@ -372,6 +373,12 @@ public boolean matches(T instrument) {
});
}

static class MetricRecorderImpl implements MetricRecorder {
}

static class BatchRecorderImpl implements BatchRecorder {
}

static class TestlogHandler extends Handler {
List<LogRecord> logs = new ArrayList<>();

Expand Down
Loading