mirror of https://github.com/grpc/grpc-java.git
xds: Remove xds authority label from metric registration
* Remove `grpc.xds.authority` label while registering `grpc.xds_client.resources` gauge, until the label value is available to record.
This commit is contained in:
parent
e3e343db8e
commit
0de7bfefb9
|
|
@ -90,7 +90,7 @@ final class XdsClientMetricReporterImpl implements XdsClientMetricReporter {
|
||||||
Arrays.asList("grpc.target", "grpc.xds.server"), Collections.emptyList(), false);
|
Arrays.asList("grpc.target", "grpc.xds.server"), Collections.emptyList(), false);
|
||||||
RESOURCES_GAUGE = metricInstrumentRegistry.registerLongGauge("grpc.xds_client.resources",
|
RESOURCES_GAUGE = metricInstrumentRegistry.registerLongGauge("grpc.xds_client.resources",
|
||||||
"EXPERIMENTAL. Number of xDS resources.", "{resource}",
|
"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);
|
"grpc.xds.resource_type"), Collections.emptyList(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@
|
||||||
package io.grpc.xds;
|
package io.grpc.xds;
|
||||||
|
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
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.any;
|
||||||
import static org.mockito.ArgumentMatchers.argThat;
|
import static org.mockito.ArgumentMatchers.argThat;
|
||||||
import static org.mockito.ArgumentMatchers.eq;
|
import static org.mockito.ArgumentMatchers.eq;
|
||||||
|
|
@ -82,14 +83,14 @@ public class XdsClientMetricReporterImplTest {
|
||||||
@Rule
|
@Rule
|
||||||
public final MockitoRule mocks = MockitoJUnit.rule();
|
public final MockitoRule mocks = MockitoJUnit.rule();
|
||||||
|
|
||||||
@Mock
|
|
||||||
private MetricRecorder mockMetricRecorder;
|
|
||||||
@Mock
|
@Mock
|
||||||
private XdsClient mockXdsClient;
|
private XdsClient mockXdsClient;
|
||||||
@Mock
|
|
||||||
private BatchRecorder mockBatchRecorder;
|
|
||||||
@Captor
|
@Captor
|
||||||
private ArgumentCaptor<BatchCallback> gaugeBatchCallbackCaptor;
|
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;
|
private XdsClientMetricReporterImpl reporter;
|
||||||
|
|
||||||
|
|
@ -372,6 +373,12 @@ public class XdsClientMetricReporterImplTest {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static class MetricRecorderImpl implements MetricRecorder {
|
||||||
|
}
|
||||||
|
|
||||||
|
static class BatchRecorderImpl implements BatchRecorder {
|
||||||
|
}
|
||||||
|
|
||||||
static class TestlogHandler extends Handler {
|
static class TestlogHandler extends Handler {
|
||||||
List<LogRecord> logs = new ArrayList<>();
|
List<LogRecord> logs = new ArrayList<>();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue