Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.
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
10 changes: 10 additions & 0 deletions google-cloud-bigtable/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,16 @@
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1738,7 +1738,6 @@ public void testAwaitOptimizeRestoredTable_NoOp() throws Exception {

// Verify: Returns immediate success (Empty) without calling the stub
assertThat(result.get()).isEqualTo(Empty.getDefaultInstance());
Mockito.verifyNoInteractions(mockStub);
}

private <ReqT, RespT, MetaT> void mockOperationResult(
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ public void testNewClientsShareTransportChannel() throws Exception {
BigtableDataClientFactory.create(
defaultSettings.toBuilder()
.setMetricsProvider(NoopMetricsProvider.INSTANCE)
.disableInternalMetrics()
.build());
BigtableDataClient ignored1 = factory.createForInstance("project1", "instance1");
BigtableDataClient ignored2 = factory.createForInstance("project2", "instance2");
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void setUp() throws IOException {
.setRefreshingChannel(false)
.build();
// Remove log noise from client side metrics
settings.setMetricsProvider(NoopMetricsProvider.INSTANCE);
settings.setMetricsProvider(NoopMetricsProvider.INSTANCE).disableInternalMetrics();
prepareAttempts =
settings.stubSettings().prepareQuerySettings().retrySettings().getMaxAttempts();
client = BigtableDataClient.create(settings.build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
import org.mockito.junit.jupiter.MockitoExtension;

@ExtendWith(MockitoExtension.class)
public class BigtableCloudMonitoringExporterTest2 {
class BigtableCloudMonitoringExporter2Test {
private static final TableName tableName =
TableName.of("fake-project", "fake-instance", "fake-table");
private static final String appProfileId = "default";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ public void testTimeSeriesForMetricWithGceOrGkeResource() {
.put(ClientSchema.INSTANCE_ID_KEY.getKey(), instanceId)
.put(ClientSchema.APP_PROFILE_KEY.getKey(), appProfileId)
.put(ClientSchema.CLIENT_NAME.getKey(), clientName)
.put(MetricLabels.CLIENT_UID.getKey(), taskId)
.build());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableRemainingDeadline;
import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableRetryCount;
import com.google.cloud.bigtable.data.v2.internal.csm.metrics.TableServerLatency;
import com.google.cloud.bigtable.data.v2.internal.csm.schema.ClientSchema;
import com.google.cloud.bigtable.data.v2.internal.csm.schema.TableSchema;
import com.google.cloud.bigtable.data.v2.models.AuthorizedViewId;
import com.google.cloud.bigtable.data.v2.models.Query;
Expand Down Expand Up @@ -169,6 +170,14 @@ public class BuiltinMetricsTracerTest {
.put(MetricLabels.APP_PROFILE_KEY, APP_PROFILE_ID)
.build();

private Attributes expectedClientSchemaBaseAttributes =
Attributes.builder()
.put(TableSchema.BIGTABLE_PROJECT_ID_KEY, PROJECT_ID)
.put(TableSchema.INSTANCE_ID_KEY, INSTANCE_ID)
.put(MetricLabels.APP_PROFILE_KEY, APP_PROFILE_ID)
.put(MetricLabels.CLIENT_NAME, "java-bigtable/" + Version.VERSION)
.build();

private InMemoryMetricReader metricReader;

private DelayProxyDetector delayProxyDetector;
Expand Down Expand Up @@ -395,6 +404,7 @@ public void testGfeMetrics() {
.put(TableSchema.CLUSTER_ID_KEY, CLUSTER)
.put(MetricLabels.CLIENT_NAME, CLIENT_NAME)
.put(MetricLabels.METHOD_KEY, "Bigtable.ReadRows")
.put(MetricLabels.STREAMING_KEY, true)
.build();

MetricData serverLatenciesMetricData = getMetricData(metricReader, TableServerLatency.NAME);
Expand All @@ -405,7 +415,7 @@ public void testGfeMetrics() {
MetricData connectivityErrorCountMetricData =
getMetricData(metricReader, TableConnectivityErrorCount.NAME);
Attributes expected1 =
expectedBaseAttributes.toBuilder()
expectedClientSchemaBaseAttributes.toBuilder()
.put(MetricLabels.STATUS_KEY, "UNAVAILABLE")
.put(TableSchema.TABLE_ID_KEY, TABLE)
.put(TableSchema.ZONE_ID_KEY, "global")
Expand All @@ -414,7 +424,7 @@ public void testGfeMetrics() {
.put(MetricLabels.CLIENT_NAME, CLIENT_NAME)
.build();
Attributes expected2 =
expectedBaseAttributes.toBuilder()
expectedClientSchemaBaseAttributes.toBuilder()
.put(MetricLabels.STATUS_KEY, "OK")
.put(TableSchema.TABLE_ID_KEY, TABLE)
.put(TableSchema.ZONE_ID_KEY, ZONE)
Expand Down Expand Up @@ -842,7 +852,7 @@ public void testBatchWriteFlowControlTargetQpsIncreased() throws InterruptedExce
MetricData targetQpsMetric =
getMetricData(metricReader, ClientBatchWriteFlowControlTargetQps.NAME);
Attributes targetQpsAttributes =
expectedBaseAttributes.toBuilder()
expectedClientSchemaBaseAttributes.toBuilder()
.put(MetricLabels.METHOD_KEY, "Bigtable.MutateRows")
.build();
double actual_qps = getAggregatedDoubleValue(targetQpsMetric, targetQpsAttributes);
Expand All @@ -851,7 +861,8 @@ public void testBatchWriteFlowControlTargetQpsIncreased() throws InterruptedExce

MetricData factorMetric = getMetricData(metricReader, ClientBatchWriteFlowControlFactor.NAME);
Attributes factorAttributes =
expectedBaseAttributes.toBuilder()
expectedClientSchemaBaseAttributes.toBuilder()
.put(ClientSchema.CLIENT_NAME, "java-bigtable/" + Version.VERSION)
.put(MetricLabels.METHOD_KEY, "Bigtable.MutateRows")
.put(MetricLabels.APPLIED_KEY, true)
.put(MetricLabels.STATUS_KEY, "OK")
Expand All @@ -874,7 +885,7 @@ public void testBatchWriteFlowControlTargetQpsDecreased() throws InterruptedExce
MetricData targetQpsMetric =
getMetricData(metricReader, ClientBatchWriteFlowControlTargetQps.NAME);
Attributes targetQpsAttributes =
expectedBaseAttributes.toBuilder()
expectedClientSchemaBaseAttributes.toBuilder()
.put(MetricLabels.METHOD_KEY, "Bigtable.MutateRows")
.build();
double actual_qps = getAggregatedDoubleValue(targetQpsMetric, targetQpsAttributes);
Expand All @@ -883,7 +894,7 @@ public void testBatchWriteFlowControlTargetQpsDecreased() throws InterruptedExce

MetricData factorMetric = getMetricData(metricReader, ClientBatchWriteFlowControlFactor.NAME);
Attributes factorAttributes =
expectedBaseAttributes.toBuilder()
expectedClientSchemaBaseAttributes.toBuilder()
.put(MetricLabels.METHOD_KEY, "Bigtable.MutateRows")
.put(MetricLabels.APPLIED_KEY, true)
.put(MetricLabels.STATUS_KEY, "OK")
Expand All @@ -906,7 +917,7 @@ public void testBatchWriteFlowControlTargetQpsCappedOnMaxFactor() throws Interru
MetricData targetQpsMetric =
getMetricData(metricReader, ClientBatchWriteFlowControlTargetQps.NAME);
Attributes targetQpsAttributes =
expectedBaseAttributes.toBuilder()
expectedClientSchemaBaseAttributes.toBuilder()
.put(MetricLabels.METHOD_KEY, "Bigtable.MutateRows")
.build();
double actual_qps = getAggregatedDoubleValue(targetQpsMetric, targetQpsAttributes);
Expand All @@ -916,7 +927,7 @@ public void testBatchWriteFlowControlTargetQpsCappedOnMaxFactor() throws Interru

MetricData factorMetric = getMetricData(metricReader, ClientBatchWriteFlowControlFactor.NAME);
Attributes factorAttributes =
expectedBaseAttributes.toBuilder()
expectedClientSchemaBaseAttributes.toBuilder()
.put(MetricLabels.METHOD_KEY, "Bigtable.MutateRows")
.put(MetricLabels.APPLIED_KEY, true)
.put(MetricLabels.STATUS_KEY, "OK")
Expand All @@ -940,7 +951,7 @@ public void testBatchWriteFlowControlTargetQpsCappedOnMinFactor() throws Interru
MetricData targetQpsMetric =
getMetricData(metricReader, ClientBatchWriteFlowControlTargetQps.NAME);
Attributes targetQpsAttributes =
expectedBaseAttributes.toBuilder()
expectedClientSchemaBaseAttributes.toBuilder()
.put(MetricLabels.METHOD_KEY, "Bigtable.MutateRows")
.build();
double actual_qps = getAggregatedDoubleValue(targetQpsMetric, targetQpsAttributes);
Expand All @@ -950,7 +961,7 @@ public void testBatchWriteFlowControlTargetQpsCappedOnMinFactor() throws Interru

MetricData factorMetric = getMetricData(metricReader, ClientBatchWriteFlowControlFactor.NAME);
Attributes factorAttributes =
expectedBaseAttributes.toBuilder()
expectedClientSchemaBaseAttributes.toBuilder()
.put(MetricLabels.METHOD_KEY, "Bigtable.MutateRows")
.put(MetricLabels.APPLIED_KEY, true)
.put(MetricLabels.STATUS_KEY, "OK")
Expand All @@ -975,7 +986,7 @@ public void testBatchWriteFlowControlTargetQpsDecreasedForError() throws Interru
MetricData targetQpsMetric =
getMetricData(metricReader, ClientBatchWriteFlowControlTargetQps.NAME);
Attributes targetQpsAttributes =
expectedBaseAttributes.toBuilder()
expectedClientSchemaBaseAttributes.toBuilder()
.put(MetricLabels.METHOD_KEY, "Bigtable.MutateRows")
.build();
double actual_qps = getAggregatedDoubleValue(targetQpsMetric, targetQpsAttributes);
Expand All @@ -985,7 +996,7 @@ public void testBatchWriteFlowControlTargetQpsDecreasedForError() throws Interru

MetricData factorMetric = getMetricData(metricReader, ClientBatchWriteFlowControlFactor.NAME);
Attributes factorAttributes =
expectedBaseAttributes.toBuilder()
expectedClientSchemaBaseAttributes.toBuilder()
.put(MetricLabels.METHOD_KEY, "Bigtable.MutateRows")
.put(MetricLabels.APPLIED_KEY, true)
.put(MetricLabels.STATUS_KEY, "UNAVAILABLE")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ public void setUp() throws IOException, IllegalAccessException, InstantiationExc
.setAppProfileId(APP_PROFILE_ID)
.setCredentialsProvider(NoCredentialsProvider.create())
.setMetricsProvider(NoopMetricsProvider.INSTANCE)
.disableInternalMetrics()
.build()
.getStubSettings();

Expand Down Expand Up @@ -266,6 +267,7 @@ public void testBatchJwtAudience()
.setEndpoint("batch-bigtable.googleapis.com:443")
.setCredentialsProvider(FixedCredentialsProvider.create(jwtCreds))
.setMetricsProvider(NoopMetricsProvider.INSTANCE)
.disableInternalMetrics()
// Use a fixed channel that will ignore the default endpoint and connect to the emulator
.setTransportChannelProvider(
FixedTransportChannelProvider.create(GrpcTransportChannel.create(channel)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public void setUp() throws Exception {
.setProjectId(PROJECT_ID)
.setInstanceId(INSTANCE_ID)
.setMetricsProvider(NoopMetricsProvider.INSTANCE)
.disableInternalMetrics()
.setCredentialsProvider(NoCredentialsProvider.create());
clientBuilder.stubSettings().setTracerFactory(tracerFactory);

Expand Down
Loading
Loading