diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml
index a454a61e8d..6610882f83 100644
--- a/.github/.OwlBot.lock.yaml
+++ b/.github/.OwlBot.lock.yaml
@@ -13,5 +13,5 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest
- digest: sha256:6d4e3a15c62cfdcb823d60e16da7521e7c6fc00eba07c8ff12e4de9924a57d28
-# created: 2022-06-29T23:17:33.110417661Z
+ digest: sha256:04f254abfe5f47fe73ae6f91d68d55c3b76e722a4943066c3bb0ce03573b4ad9
+# created: 2022-07-18T21:44:23.94208526Z
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 7c4d9ac88e..63b6b62ecf 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -6,7 +6,10 @@
# The @googleapis/api-bigtable is the default owner for changes in this repo
* @googleapis/yoshi-java @googleapis/api-bigtable
+
+# for handwritten libraries, keep codeowner_team in .repo-metadata.json as owner
**/*.java @googleapis/api-bigtable
+
# The java-samples-reviewers team is the default owner for samples changes
samples/**/*.java @googleapis/java-samples-reviewers
diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml
index eb1713524e..36d4054793 100644
--- a/.github/sync-repo-settings.yaml
+++ b/.github/sync-repo-settings.yaml
@@ -17,6 +17,8 @@ branchProtectionRules:
- 'Kokoro - Test: Integration'
- cla/google
- OwlBot Post Processor
+ - 'Kokoro - Test: Java GraalVM Native Image'
+ - 'Kokoro - Test: Java 17 GraalVM Native Image'
- pattern: 1.22.0-sp
isAdminEnforced: true
requiredApprovingReviewCount: 1
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index 83ef7f9c2c..e3bb26e377 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -39,6 +39,8 @@ jobs:
windows:
runs-on: windows-latest
steps:
+ - name: Support longpaths
+ run: git config --system core.longpaths true
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
diff --git a/.readme-partials.yml b/.readme-partials.yml
index dd804349e4..0cf67de41e 100644
--- a/.readme-partials.yml
+++ b/.readme-partials.yml
@@ -115,6 +115,19 @@ custom_content: |
TIP: If you are experiencing version conflicts with gRPC, see [Version Conflicts](#version-conflicts).
+ ## Enabling client side metrics
+
+ Cloud Bigtable client supports publishing client side metrics to
+ [Cloud Monitoring](https://cloud.google.com/monitoring/docs/monitoring-overview) under the
+ `bigtable.googleapis.com/client` namespace.
+
+ Please fill out this [Google Form](https://forms.gle/xuhu6vCunn2MjV2m9) to sign up for the private preview of this
+ feature. And enable it by setting:
+
+ ```java
+ BigtableDataSettings.enableBuiltinMetrics();
+ ```
+
## Client request tracing: OpenCensus Tracing
Cloud Bigtable client supports [OpenCensus Tracing](https://opencensus.io/tracing/),
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 78b9bfbe8f..40afb09b71 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,80 @@
# Changelog
+## [2.11.1](https://github.com/googleapis/java-bigtable/compare/v2.11.0...v2.11.1) (2022-08-26)
+
+
+### Bug Fixes
+
+* reset a measure map everytime the stats are recorded ([#1364](https://github.com/googleapis/java-bigtable/issues/1364)) ([1683365](https://github.com/googleapis/java-bigtable/commit/1683365938178bb61b1e9c871f1971449ee942c2))
+
+## [2.11.0](https://github.com/googleapis/java-bigtable/compare/v2.10.3...v2.11.0) (2022-08-17)
+
+
+### Features
+
+* add stackdriver exporter ([#1247](https://github.com/googleapis/java-bigtable/issues/1247)) ([7ce915e](https://github.com/googleapis/java-bigtable/commit/7ce915e34c1ccce30bee78bda9e024a620cde737))
+
+
+### Dependencies
+
+* update dependency com.google.cloud:google-cloud-monitoring-bom to v3.4.1 ([#1352](https://github.com/googleapis/java-bigtable/issues/1352)) ([f8d97e5](https://github.com/googleapis/java-bigtable/commit/f8d97e557318eab214f3d916c029bfa153cf7455))
+
+## [2.10.3](https://github.com/googleapis/java-bigtable/compare/v2.10.2...v2.10.3) (2022-08-08)
+
+
+### Bug Fixes
+
+* declaring 2 http libraries as runtime ([#1341](https://github.com/googleapis/java-bigtable/issues/1341)) ([8071de6](https://github.com/googleapis/java-bigtable/commit/8071de6235a6c1aa5873902ca55beaa2a8d64276))
+
+## [2.10.2](https://github.com/googleapis/java-bigtable/compare/v2.10.1...v2.10.2) (2022-08-03)
+
+
+### Bug Fixes
+
+* add a ReadFirstRow callable to set future in onComplete ([#1326](https://github.com/googleapis/java-bigtable/issues/1326)) ([cb539b5](https://github.com/googleapis/java-bigtable/commit/cb539b50d98ec2a8538ce4691b2639426ca95464))
+* The metadata could be returned in trailer or header depends on i… ([#1337](https://github.com/googleapis/java-bigtable/issues/1337)) ([c4b8c03](https://github.com/googleapis/java-bigtable/commit/c4b8c03ece7b3f6ec2cea42ff0ca5ac617528060))
+
+
+### Dependencies
+
+* update dependency com.google.cloud:google-cloud-shared-dependencies to v3 ([#1328](https://github.com/googleapis/java-bigtable/issues/1328)) ([bee0ca0](https://github.com/googleapis/java-bigtable/commit/bee0ca036ab6e711f6069159364f6d3b691e6bfd))
+* upgrade shared config to 1.5.3, exclude google-http-client and google-http-client-gson from gax in google-cloud-bigtable-stats ([#1336](https://github.com/googleapis/java-bigtable/issues/1336)) ([98b3349](https://github.com/googleapis/java-bigtable/commit/98b33498d85325d22737fb4bd66826519e96755a))
+
+## [2.10.1](https://github.com/googleapis/java-bigtable/compare/v2.10.0...v2.10.1) (2022-08-01)
+
+
+### Bug Fixes
+
+* retry rst stream in mutations ([#1327](https://github.com/googleapis/java-bigtable/issues/1327)) ([1a5b3a2](https://github.com/googleapis/java-bigtable/commit/1a5b3a215b5388678241cadec26a962a512157ac))
+
+
+### Dependencies
+
+* update dependency org.junit.vintage:junit-vintage-engine to v5.9.0 ([#1323](https://github.com/googleapis/java-bigtable/issues/1323)) ([7655747](https://github.com/googleapis/java-bigtable/commit/76557476744a6404b9df30c97c59f0a7e38a1ed8))
+
+## [2.10.0](https://github.com/googleapis/java-bigtable/compare/v2.9.0...v2.10.0) (2022-07-26)
+
+
+### Features
+
+* add response protos ([#1246](https://github.com/googleapis/java-bigtable/issues/1246)) ([52d59ce](https://github.com/googleapis/java-bigtable/commit/52d59ce18fb5536a17a5cb59da39e563e4afede4))
+* add response_params proto to clients ([#1303](https://github.com/googleapis/java-bigtable/issues/1303)) ([93edfe1](https://github.com/googleapis/java-bigtable/commit/93edfe1e43dcfefda6bba3e9ee53ed80eaf2e5c2))
+* add storage utilization gib per node for autoscaling ([#1317](https://github.com/googleapis/java-bigtable/issues/1317)) ([5282589](https://github.com/googleapis/java-bigtable/commit/52825891af0e4ec2dd76c0c6fa1379a98a77a08f))
+* use PingAndWarm request for channel priming ([#1179](https://github.com/googleapis/java-bigtable/issues/1179)) ([6629821](https://github.com/googleapis/java-bigtable/commit/6629821ea3200d3a5b93c9d45aab6d57485fcebf))
+
+
+### Bug Fixes
+
+* enable integration test for google-cloud-bigtable-stats ([#1311](https://github.com/googleapis/java-bigtable/issues/1311)) ([7c77879](https://github.com/googleapis/java-bigtable/commit/7c7787998b164ceb55472c0d06c083a835e5d000))
+* fix race condition in BuiltinMetricsTracer ([#1320](https://github.com/googleapis/java-bigtable/issues/1320)) ([644454a](https://github.com/googleapis/java-bigtable/commit/644454a9723da359677052b7a4b9201e91e9a78a))
+* ignore repackaged files to fix clirr ([#1300](https://github.com/googleapis/java-bigtable/issues/1300)) ([99b67ba](https://github.com/googleapis/java-bigtable/commit/99b67ba5b1625686ac7802a6e40dafc2edceade0))
+
+
+### Dependencies
+
+* update dependency org.graalvm.buildtools:junit-platform-native to v0.9.13 ([#1306](https://github.com/googleapis/java-bigtable/issues/1306)) ([ddae354](https://github.com/googleapis/java-bigtable/commit/ddae3540fd68e8f79d94d49c96c5685e1bad2f66))
+* update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.13 ([#1307](https://github.com/googleapis/java-bigtable/issues/1307)) ([c0740fe](https://github.com/googleapis/java-bigtable/commit/c0740fe30c5cd2bdf6dedf901e2fdb9a84ce64a1))
+
## [2.9.0](https://github.com/googleapis/java-bigtable/compare/v2.8.0...v2.9.0) (2022-06-30)
diff --git a/README.md b/README.md
index 2e403afad0..87450e5569 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@ Java idiomatic client for [Cloud Bigtable][product-docs].
## Quickstart
-If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file
+If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
```xml
@@ -19,7 +19,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file
com.google.cloud
libraries-bom
- 25.4.0
+ 26.1.1
pom
import
@@ -41,28 +41,28 @@ If you are using Maven without BOM, add this to your dependencies:
com.google.cloud
google-cloud-bigtable
- 2.9.0
+ 2.11.1
```
-If you are using Gradle 5.x or later, add this to your dependencies
+If you are using Gradle 5.x or later, add this to your dependencies:
```Groovy
-implementation platform('com.google.cloud:libraries-bom:26.0.0')
+implementation platform('com.google.cloud:libraries-bom:26.1.1')
implementation 'com.google.cloud:google-cloud-bigtable'
```
-If you are using Gradle without BOM, add this to your dependencies
+If you are using Gradle without BOM, add this to your dependencies:
```Groovy
-implementation 'com.google.cloud:google-cloud-bigtable:2.9.0'
+implementation 'com.google.cloud:google-cloud-bigtable:2.11.1'
```
-If you are using SBT, add this to your dependencies
+If you are using SBT, add this to your dependencies:
```Scala
-libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "2.9.0"
+libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "2.11.1"
```
## Authentication
@@ -213,6 +213,19 @@ try {
TIP: If you are experiencing version conflicts with gRPC, see [Version Conflicts](#version-conflicts).
+## Enabling client side metrics
+
+Cloud Bigtable client supports publishing client side metrics to
+[Cloud Monitoring](https://cloud.google.com/monitoring/docs/monitoring-overview) under the
+`bigtable.googleapis.com/client` namespace.
+
+Please fill out this [Google Form](https://forms.gle/xuhu6vCunn2MjV2m9) to sign up for the private preview of this
+feature. And enable it by setting:
+
+```java
+BigtableDataSettings.enableBuiltinMetrics();
+```
+
## Client request tracing: OpenCensus Tracing
Cloud Bigtable client supports [OpenCensus Tracing](https://opencensus.io/tracing/),
diff --git a/google-cloud-bigtable-bom/pom.xml b/google-cloud-bigtable-bom/pom.xml
index 103720ba06..42d5e00ed9 100644
--- a/google-cloud-bigtable-bom/pom.xml
+++ b/google-cloud-bigtable-bom/pom.xml
@@ -3,12 +3,13 @@
4.0.0
com.google.cloud
google-cloud-bigtable-bom
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
pom
com.google.cloud
google-cloud-shared-config
1.5.1
+
Google Cloud Bigtable BOM
@@ -62,42 +63,42 @@
com.google.cloud
google-cloud-bigtable
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
com.google.cloud
google-cloud-bigtable-emulator
- 0.146.1-SNAPSHOT
+ 0.148.2-SNAPSHOT
com.google.cloud
google-cloud-bigtable-emulator-core
- 0.146.1-SNAPSHOT
+ 0.148.2-SNAPSHOT
com.google.api.grpc
grpc-google-cloud-bigtable-admin-v2
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
com.google.api.grpc
grpc-google-cloud-bigtable-v2
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
com.google.api.grpc
proto-google-cloud-bigtable-admin-v2
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
com.google.api.grpc
proto-google-cloud-bigtable-v2
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
com.google.cloud
google-cloud-bigtable-stats
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
diff --git a/google-cloud-bigtable-deps-bom/pom.xml b/google-cloud-bigtable-deps-bom/pom.xml
index a6fc7e987b..c1daa36633 100644
--- a/google-cloud-bigtable-deps-bom/pom.xml
+++ b/google-cloud-bigtable-deps-bom/pom.xml
@@ -8,11 +8,12 @@
com.google.cloud
google-cloud-shared-config
1.5.1
+
com.google.cloud
google-cloud-bigtable-deps-bom
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
pom
@@ -65,7 +66,7 @@
com.google.cloud
google-cloud-shared-dependencies
- 2.13.0
+ 3.0.1
pom
import
diff --git a/google-cloud-bigtable-emulator-core/pom.xml b/google-cloud-bigtable-emulator-core/pom.xml
index 8b17245007..e9b6c5c6a2 100644
--- a/google-cloud-bigtable-emulator-core/pom.xml
+++ b/google-cloud-bigtable-emulator-core/pom.xml
@@ -7,11 +7,11 @@
google-cloud-bigtable-parent
com.google.cloud
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
google-cloud-bigtable-emulator-core
- 0.146.1-SNAPSHOT
+ 0.148.2-SNAPSHOT
A Java wrapper for the Cloud Bigtable emulator.
diff --git a/google-cloud-bigtable-emulator/pom.xml b/google-cloud-bigtable-emulator/pom.xml
index efdd414172..6a4454705c 100644
--- a/google-cloud-bigtable-emulator/pom.xml
+++ b/google-cloud-bigtable-emulator/pom.xml
@@ -5,7 +5,7 @@
4.0.0
google-cloud-bigtable-emulator
- 0.146.1-SNAPSHOT
+ 0.148.2-SNAPSHOT
Google Cloud Java - Bigtable Emulator
https://github.com/googleapis/java-bigtable
@@ -14,7 +14,7 @@
com.google.cloud
google-cloud-bigtable-parent
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
scm:git:git@github.com:googleapis/java-bigtable.git
@@ -81,14 +81,14 @@
com.google.cloud
google-cloud-bigtable-deps-bom
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
pom
import
com.google.cloud
google-cloud-bigtable-bom
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
pom
import
@@ -99,7 +99,7 @@
com.google.cloud
google-cloud-bigtable-emulator-core
- 0.146.1-SNAPSHOT
+ 0.148.2-SNAPSHOT
diff --git a/google-cloud-bigtable-stats/clirr-ignored-differences.xml b/google-cloud-bigtable-stats/clirr-ignored-differences.xml
index 2c35667623..ff42f58da4 100644
--- a/google-cloud-bigtable-stats/clirr-ignored-differences.xml
+++ b/google-cloud-bigtable-stats/clirr-ignored-differences.xml
@@ -7,4 +7,10 @@
*StatsRecorderWrapper*
*StatsRecorder*
+
+
+ 7002
+ com/google/cloud/bigtable/stats/StatsRecorderWrapper
+ void record(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
+
diff --git a/google-cloud-bigtable-stats/pom.xml b/google-cloud-bigtable-stats/pom.xml
index 44d3a6949d..5b950728a8 100644
--- a/google-cloud-bigtable-stats/pom.xml
+++ b/google-cloud-bigtable-stats/pom.xml
@@ -5,7 +5,7 @@
com.google.cloud
google-cloud-bigtable-parent
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
4.0.0
@@ -13,15 +13,26 @@
through Stackdriver. Built-in metrics will be implemented with shaded OpenCensus so it won't interfere with
customer's application metrics. -->
google-cloud-bigtable-stats
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
Experimental project to shade OpenCensus dependencies.
+
+ 3.4.1
+
+
com.google.cloud
google-cloud-bigtable-deps-bom
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
+ pom
+ import
+
+
+ com.google.cloud
+ google-cloud-monitoring-bom
+ ${cloud.monitoring.version}
pom
import
@@ -29,29 +40,97 @@
+
+
+ io.opencensus
+ opencensus-api
+
+
+ io.opencensus
+ opencensus-exporter-stats-stackdriver
+
+
+ io.opencensus
+ opencensus-impl
+ runtime
+
+
+
+
+ com.google.cloud
+ google-cloud-monitoring
+
+
+
+ com.google.http-client
+ google-http-client-gson
+
+
+ com.google.http-client
+ google-http-client
+
+
+
+
+ com.google.api.grpc
+ proto-google-cloud-monitoring-v3
+
+
+ com.google.api.grpc
+ proto-google-common-protos
+
+
+ com.google.auth
+ google-auth-library-credentials
+
com.google.api
gax
+
+
+
+ com.google.http-client
+ google-http-client
+
+
+ com.google.http-client
+ google-http-client-gson
+
+
com.google.api
api-common
-
- io.opencensus
- opencensus-api
+ com.google.api
+ gax-grpc
+
+
+ com.google.protobuf
+ protobuf-java
com.google.guava
guava
+
+ org.threeten
+ threetenbp
+
+
+ com.google.code.findbugs
+ jsr305
+
+
- io.opencensus
- opencensus-impl
+ com.google.http-client
+ google-http-client
runtime
+
+
com.google.truth
truth
@@ -62,6 +141,11 @@
junit
test
+
+ org.mockito
+ mockito-core
+ test
+
@@ -80,6 +164,7 @@
false
true
+
io.opencensus:*
@@ -92,6 +177,13 @@
+
+
+
+
+
@@ -100,6 +192,17 @@
org.apache.maven.plugins
maven-dependency-plugin
3.3.0
+
+
+
+
+
+
+
+ io.opencensus:opencensus-exporter-metrics-util:*
+ io.opencensus:opencensus-exporter-stats-stackdriver:*
+
+
org.codehaus.mojo
@@ -110,6 +213,51 @@
+
+ org.apache.maven.plugins
+ maven-enforcer-plugin
+
+
+ enforce-version-consistency
+
+ enforce
+
+
+
+
+
+
+
+
+ io.opencensus:*:[0.31.1]
+ io.opencensus:opencensus-proto:[0.2.0]
+
+
+
+
+
+
+
+
+ org.codehaus.mojo
+ license-maven-plugin
+ 2.0.0
+
+
+ default-cli
+ generate-resources
+
+ add-third-party
+
+
+ test
+
+ io.opencensus:*
+ true
+
+
+
+
diff --git a/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/BigtableCreateTimeSeriesExporter.java b/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/BigtableCreateTimeSeriesExporter.java
new file mode 100644
index 0000000000..ad2e76867c
--- /dev/null
+++ b/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/BigtableCreateTimeSeriesExporter.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.bigtable.stats;
+
+import com.google.api.MonitoredResource;
+import com.google.cloud.monitoring.v3.MetricServiceClient;
+import com.google.monitoring.v3.CreateTimeSeriesRequest;
+import com.google.monitoring.v3.ProjectName;
+import io.opencensus.exporter.metrics.util.MetricExporter;
+import io.opencensus.metrics.export.Metric;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.stream.Collectors;
+
+final class BigtableCreateTimeSeriesExporter extends MetricExporter {
+ private static final Logger logger =
+ Logger.getLogger(BigtableCreateTimeSeriesExporter.class.getName());
+ private final MetricServiceClient metricServiceClient;
+ private final MonitoredResource monitoredResource;
+ private final String clientId;
+
+ BigtableCreateTimeSeriesExporter(
+ MetricServiceClient metricServiceClient, MonitoredResource monitoredResource) {
+ this.metricServiceClient = metricServiceClient;
+ this.monitoredResource = monitoredResource;
+ this.clientId = BigtableStackdriverExportUtils.getDefaultTaskValue();
+ }
+
+ public void export(Collection metrics) {
+ Map> projectToTimeSeries = new HashMap<>();
+
+ for (Metric metric : metrics) {
+ // only export bigtable metrics
+ if (!metric.getMetricDescriptor().getName().contains("bigtable")) {
+ continue;
+ }
+
+ try {
+ projectToTimeSeries =
+ metric.getTimeSeriesList().stream()
+ .collect(
+ Collectors.groupingBy(
+ timeSeries ->
+ BigtableStackdriverExportUtils.getProjectId(
+ metric.getMetricDescriptor(), timeSeries),
+ Collectors.mapping(
+ timeSeries ->
+ BigtableStackdriverExportUtils.convertTimeSeries(
+ metric.getMetricDescriptor(),
+ timeSeries,
+ clientId,
+ monitoredResource),
+ Collectors.toList())));
+
+ for (Map.Entry> entry :
+ projectToTimeSeries.entrySet()) {
+ ProjectName projectName = ProjectName.of(entry.getKey());
+ CreateTimeSeriesRequest request =
+ CreateTimeSeriesRequest.newBuilder()
+ .setName(projectName.toString())
+ .addAllTimeSeries(entry.getValue())
+ .build();
+ this.metricServiceClient.createServiceTimeSeries(request);
+ }
+ } catch (Throwable e) {
+ logger.log(Level.WARNING, "Exception thrown when exporting TimeSeries.", e);
+ }
+ }
+ }
+}
diff --git a/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/BigtableStackdriverExportUtils.java b/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/BigtableStackdriverExportUtils.java
new file mode 100644
index 0000000000..bdca097050
--- /dev/null
+++ b/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/BigtableStackdriverExportUtils.java
@@ -0,0 +1,275 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.bigtable.stats;
+
+import com.google.api.Distribution.BucketOptions;
+import com.google.api.Distribution.BucketOptions.Explicit;
+import com.google.api.Metric;
+import com.google.api.MetricDescriptor.MetricKind;
+import com.google.api.MonitoredResource;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Maps;
+import com.google.monitoring.v3.TimeInterval;
+import com.google.monitoring.v3.TypedValue;
+import io.opencensus.common.Function;
+import io.opencensus.common.Functions;
+import io.opencensus.common.Timestamp;
+import io.opencensus.metrics.LabelKey;
+import io.opencensus.metrics.LabelValue;
+import io.opencensus.metrics.export.Distribution;
+import io.opencensus.metrics.export.Distribution.Bucket;
+import io.opencensus.metrics.export.Distribution.BucketOptions.ExplicitOptions;
+import io.opencensus.metrics.export.MetricDescriptor;
+import io.opencensus.metrics.export.MetricDescriptor.Type;
+import io.opencensus.metrics.export.Point;
+import io.opencensus.metrics.export.Summary;
+import io.opencensus.metrics.export.TimeSeries;
+import io.opencensus.metrics.export.Value;
+import java.lang.management.ManagementFactory;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.security.SecureRandom;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.annotation.Nullable;
+
+class BigtableStackdriverExportUtils {
+
+ private static final Logger logger =
+ Logger.getLogger(BigtableStackdriverExportUtils.class.getName());
+
+ private static final Function typedValueDoubleFunction =
+ arg -> {
+ TypedValue.Builder builder = TypedValue.newBuilder();
+ builder.setDoubleValue(arg);
+ return builder.build();
+ };
+ private static final Function typedValueLongFunction =
+ arg -> {
+ TypedValue.Builder builder = TypedValue.newBuilder();
+ builder.setInt64Value(arg);
+ return builder.build();
+ };
+ private static final Function typedValueDistributionFunction =
+ arg -> {
+ TypedValue.Builder builder = TypedValue.newBuilder();
+ return builder
+ .setDistributionValue(BigtableStackdriverExportUtils.createDistribution(arg))
+ .build();
+ };
+ private static final Function typedValueSummaryFunction =
+ arg -> {
+ TypedValue.Builder builder = TypedValue.newBuilder();
+ return builder.build();
+ };
+ private static final Function bucketOptionsExplicitFunction =
+ arg -> {
+ BucketOptions.Builder builder = BucketOptions.newBuilder();
+ Explicit.Builder explicitBuilder = Explicit.newBuilder();
+ explicitBuilder.addBounds(0.0D);
+ explicitBuilder.addAllBounds(arg.getBucketBoundaries());
+ builder.setExplicitBuckets(explicitBuilder.build());
+ return builder.build();
+ };
+
+ // promote the following metric labels to monitored resource labels
+ private static final Set PROMOTED_RESOURCE_LABELS =
+ ImmutableSet.of(
+ BuiltinMeasureConstants.PROJECT_ID.getName(),
+ BuiltinMeasureConstants.INSTANCE_ID.getName(),
+ BuiltinMeasureConstants.CLUSTER.getName(),
+ BuiltinMeasureConstants.ZONE.getName(),
+ BuiltinMeasureConstants.TABLE.getName());
+
+ private static final LabelKey CLIENT_UID_LABEL_KEY =
+ LabelKey.create(BuiltinMeasureConstants.CLIENT_UID.getName(), "client uid");
+
+ static com.google.monitoring.v3.TimeSeries convertTimeSeries(
+ MetricDescriptor metricDescriptor,
+ TimeSeries timeSeries,
+ String clientId,
+ MonitoredResource monitoredResource) {
+ String metricName = metricDescriptor.getName();
+ List labelKeys = metricDescriptor.getLabelKeys();
+ Type metricType = metricDescriptor.getType();
+
+ MonitoredResource.Builder monitoredResourceBuilder = monitoredResource.toBuilder();
+
+ List metricTagKeys = new ArrayList<>();
+ List metricTagValues = new ArrayList<>();
+
+ List labelValues = timeSeries.getLabelValues();
+ for (int i = 0; i < labelValues.size(); i++) {
+ // If the label is defined in the monitored resource, convert it to
+ // a monitored resource label. Otherwise, keep it as a metric label.
+ if (PROMOTED_RESOURCE_LABELS.contains(labelKeys.get(i).getKey())) {
+ monitoredResourceBuilder.putLabels(
+ labelKeys.get(i).getKey(), labelValues.get(i).getValue());
+ } else {
+ metricTagKeys.add(labelKeys.get(i));
+ metricTagValues.add(labelValues.get(i));
+ }
+ }
+ metricTagKeys.add(CLIENT_UID_LABEL_KEY);
+ metricTagValues.add(LabelValue.create(clientId));
+
+ com.google.monitoring.v3.TimeSeries.Builder builder =
+ com.google.monitoring.v3.TimeSeries.newBuilder();
+ builder.setResource(monitoredResourceBuilder.build());
+ builder.setMetric(createMetric(metricName, metricTagKeys, metricTagValues));
+ builder.setMetricKind(createMetricKind(metricType));
+ builder.setValueType(createValueType(metricType));
+ Timestamp startTimeStamp = timeSeries.getStartTimestamp();
+ for (Point point : timeSeries.getPoints()) {
+ builder.addPoints(createPoint(point, startTimeStamp));
+ }
+ return builder.build();
+ }
+
+ static String getProjectId(MetricDescriptor metricDescriptor, TimeSeries timeSeries) {
+ List labelKeys = metricDescriptor.getLabelKeys();
+ List labelValues = timeSeries.getLabelValues();
+ for (int i = 0; i < labelKeys.size(); i++) {
+ if (labelKeys.get(i).getKey().equals(BuiltinMeasureConstants.PROJECT_ID.getName())) {
+ return labelValues.get(i).getValue();
+ }
+ }
+ throw new IllegalStateException("Can't find project id for the current timeseries");
+ }
+
+ static String getDefaultTaskValue() {
+ // Something like '@'
+ final String jvmName = ManagementFactory.getRuntimeMXBean().getName();
+ // If not the expected format then generate a random number.
+ if (jvmName.indexOf('@') < 1) {
+ String hostname = "localhost";
+ try {
+ hostname = InetAddress.getLocalHost().getHostName();
+ } catch (UnknownHostException e) {
+ logger.log(Level.INFO, "Unable to get the hostname.", e);
+ }
+ // Generate a random number and use the same format "random_number@hostname".
+ return "java-" + new SecureRandom().nextInt() + "@" + hostname;
+ }
+ return "java-" + jvmName;
+ }
+
+ private static MetricKind createMetricKind(Type type) {
+ switch (type) {
+ case CUMULATIVE_DOUBLE:
+ case CUMULATIVE_INT64:
+ case CUMULATIVE_DISTRIBUTION:
+ return MetricKind.CUMULATIVE;
+ default:
+ return MetricKind.UNRECOGNIZED;
+ }
+ }
+
+ private static com.google.api.MetricDescriptor.ValueType createValueType(Type type) {
+ switch (type) {
+ case CUMULATIVE_DOUBLE:
+ return com.google.api.MetricDescriptor.ValueType.DOUBLE;
+ case CUMULATIVE_INT64:
+ return com.google.api.MetricDescriptor.ValueType.INT64;
+ case CUMULATIVE_DISTRIBUTION:
+ return com.google.api.MetricDescriptor.ValueType.DISTRIBUTION;
+ default:
+ return com.google.api.MetricDescriptor.ValueType.UNRECOGNIZED;
+ }
+ }
+
+ private static Metric createMetric(
+ String metricName, List labelKeys, List labelValues) {
+ Metric.Builder builder = Metric.newBuilder();
+ builder.setType(metricName);
+ Map stringTagMap = Maps.newHashMap();
+
+ for (int i = 0; i < labelValues.size(); ++i) {
+ String value = labelValues.get(i).getValue();
+ if (value != null) {
+ stringTagMap.put(labelKeys.get(i).getKey(), value);
+ }
+ }
+
+ builder.putAllLabels(stringTagMap);
+ return builder.build();
+ }
+
+ private static com.google.monitoring.v3.Point createPoint(Point point, Timestamp startTimestamp) {
+ com.google.monitoring.v3.TimeInterval.Builder timeIntervalBuilder = TimeInterval.newBuilder();
+ timeIntervalBuilder.setStartTime(convertTimestamp(startTimestamp));
+ timeIntervalBuilder.setEndTime(convertTimestamp(point.getTimestamp()));
+
+ com.google.monitoring.v3.Point.Builder builder = com.google.monitoring.v3.Point.newBuilder();
+ builder.setInterval(timeIntervalBuilder.build());
+ builder.setValue(createTypedValue(point.getValue()));
+ return builder.build();
+ }
+
+ private static TypedValue createTypedValue(Value value) {
+ return value.match(
+ typedValueDoubleFunction,
+ typedValueLongFunction,
+ typedValueDistributionFunction,
+ typedValueSummaryFunction,
+ Functions.throwIllegalArgumentException());
+ }
+
+ private static com.google.api.Distribution createDistribution(Distribution distribution) {
+ com.google.api.Distribution.Builder builder =
+ com.google.api.Distribution.newBuilder()
+ .setBucketOptions(createBucketOptions(distribution.getBucketOptions()))
+ .setCount(distribution.getCount())
+ .setMean(
+ distribution.getCount() == 0L
+ ? 0.0D
+ : distribution.getSum() / (double) distribution.getCount())
+ .setSumOfSquaredDeviation(distribution.getSumOfSquaredDeviations());
+ setBucketCounts(distribution.getBuckets(), builder);
+ return builder.build();
+ }
+
+ private static BucketOptions createBucketOptions(
+ @Nullable Distribution.BucketOptions bucketOptions) {
+ com.google.api.Distribution.BucketOptions.Builder builder = BucketOptions.newBuilder();
+ return bucketOptions == null
+ ? builder.build()
+ : bucketOptions.match(
+ bucketOptionsExplicitFunction, Functions.throwIllegalArgumentException());
+ }
+
+ private static void setBucketCounts(
+ List buckets, com.google.api.Distribution.Builder builder) {
+ builder.addBucketCounts(0L);
+
+ for (Bucket bucket : buckets) {
+ builder.addBucketCounts(bucket.getCount());
+ }
+ }
+
+ private static com.google.protobuf.Timestamp convertTimestamp(Timestamp censusTimestamp) {
+ return censusTimestamp.getSeconds() < 0L
+ ? com.google.protobuf.Timestamp.newBuilder().build()
+ : com.google.protobuf.Timestamp.newBuilder()
+ .setSeconds(censusTimestamp.getSeconds())
+ .setNanos(censusTimestamp.getNanos())
+ .build();
+ }
+}
diff --git a/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/BigtableStackdriverStatsExporter.java b/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/BigtableStackdriverStatsExporter.java
new file mode 100644
index 0000000000..8896e52d89
--- /dev/null
+++ b/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/BigtableStackdriverStatsExporter.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.bigtable.stats;
+
+import com.google.api.MonitoredResource;
+import com.google.api.core.InternalApi;
+import com.google.api.gax.core.FixedCredentialsProvider;
+import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.auth.Credentials;
+import com.google.cloud.monitoring.v3.MetricServiceClient;
+import com.google.cloud.monitoring.v3.MetricServiceSettings;
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.Preconditions;
+import io.opencensus.common.Duration;
+import io.opencensus.exporter.metrics.util.IntervalMetricReader;
+import io.opencensus.exporter.metrics.util.MetricReader;
+import io.opencensus.metrics.Metrics;
+import java.io.IOException;
+import javax.annotation.Nullable;
+import javax.annotation.concurrent.GuardedBy;
+
+@InternalApi
+public class BigtableStackdriverStatsExporter {
+ static final Object lock = new Object();
+
+ @Nullable
+ @GuardedBy("lock")
+ private static BigtableStackdriverStatsExporter instance = null;
+
+ // Default export interval is 1 minute
+ private static final Duration EXPORT_INTERVAL = Duration.create(60, 0);
+ private static final String RESOURCE_TYPE = "bigtable_client_raw";
+
+ private final IntervalMetricReader intervalMetricReader;
+
+ private BigtableStackdriverStatsExporter(
+ MetricServiceClient metricServiceClient,
+ Duration exportInterval,
+ MonitoredResource monitoredResource) {
+ IntervalMetricReader.Options.Builder intervalMetricReaderOptionsBuilder =
+ IntervalMetricReader.Options.builder();
+ intervalMetricReaderOptionsBuilder.setExportInterval(exportInterval);
+ this.intervalMetricReader =
+ IntervalMetricReader.create(
+ new BigtableCreateTimeSeriesExporter(metricServiceClient, monitoredResource),
+ MetricReader.create(
+ MetricReader.Options.builder()
+ .setMetricProducerManager(
+ Metrics.getExportComponent().getMetricProducerManager())
+ .build()),
+ intervalMetricReaderOptionsBuilder.build());
+ }
+
+ public static void register(Credentials credentials) throws IOException {
+ synchronized (lock) {
+ Preconditions.checkState(
+ instance == null, "Bigtable Stackdriver stats exporter is already created");
+ // Default timeout for creating a client is 1 minute
+ MetricServiceClient client = createMetricServiceClient(credentials, Duration.create(60L, 0));
+ MonitoredResource resourceType =
+ MonitoredResource.newBuilder().setType(RESOURCE_TYPE).build();
+ instance = new BigtableStackdriverStatsExporter(client, EXPORT_INTERVAL, resourceType);
+ }
+ }
+
+ @GuardedBy("lock")
+ @VisibleForTesting
+ static MetricServiceClient createMetricServiceClient(Credentials credentials, Duration deadline)
+ throws IOException {
+ MetricServiceSettings.Builder settingsBuilder =
+ MetricServiceSettings.newBuilder()
+ .setTransportChannelProvider(InstantiatingGrpcChannelProvider.newBuilder().build());
+ settingsBuilder.setCredentialsProvider(FixedCredentialsProvider.create(credentials));
+
+ org.threeten.bp.Duration stackdriverDuration =
+ org.threeten.bp.Duration.ofMillis(deadline.toMillis());
+ settingsBuilder.createTimeSeriesSettings().setSimpleTimeoutNoRetries(stackdriverDuration);
+ return MetricServiceClient.create(settingsBuilder.build());
+ }
+}
diff --git a/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/BuiltinMeasureConstants.java b/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/BuiltinMeasureConstants.java
index 06ca674ffc..2f51204d4b 100644
--- a/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/BuiltinMeasureConstants.java
+++ b/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/BuiltinMeasureConstants.java
@@ -23,12 +23,11 @@
class BuiltinMeasureConstants {
// Monitored resource TagKeys
static final TagKey PROJECT_ID = TagKey.create("project_id");
- static final TagKey INSTANCE_ID = TagKey.create("instance_id");
+ static final TagKey INSTANCE_ID = TagKey.create("instance");
static final TagKey CLUSTER = TagKey.create("cluster");
static final TagKey TABLE = TagKey.create("table");
static final TagKey ZONE = TagKey.create("zone");
- // Placeholder TagKey to be used in Stackdriver exporter
- static final TagKey CLIENT_ID = TagKey.create("client_id");
+ static final TagKey CLIENT_UID = TagKey.create("client_uid");
// Metrics TagKeys
static final TagKey APP_PROFILE = TagKey.create("app_profile");
diff --git a/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/BuiltinViewConstants.java b/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/BuiltinViewConstants.java
index beceeeab83..7c9dc34d78 100644
--- a/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/BuiltinViewConstants.java
+++ b/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/BuiltinViewConstants.java
@@ -59,7 +59,7 @@ class BuiltinViewConstants {
1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 15.0, 20.0, 30.0, 40.0, 50.0,
100.0)));
- private static final Aggregation AGGREGATION_ERROR_COUNT = Sum.create();
+ private static final Aggregation AGGREGATION_COUNT = Sum.create();
static final View OPERATION_LATENCIES_VIEW =
View.create(
@@ -102,7 +102,7 @@ class BuiltinViewConstants {
View.Name.create("bigtable.googleapis.com/internal/client/retry_count"),
"The number of additional RPCs sent after the initial attempt.",
RETRY_COUNT,
- AGGREGATION_RETRY_COUNT,
+ AGGREGATION_COUNT,
ImmutableList.of(
PROJECT_ID,
INSTANCE_ID,
@@ -154,7 +154,7 @@ class BuiltinViewConstants {
View.Name.create("bigtable.googleapis.com/internal/client/connectivity_error_count"),
"Number of requests that failed to reach the Google datacenter. (Requests without google response headers).",
CONNECTIVITY_ERROR_COUNT,
- AGGREGATION_ERROR_COUNT,
+ AGGREGATION_COUNT,
ImmutableList.of(
PROJECT_ID,
INSTANCE_ID,
@@ -173,15 +173,7 @@ class BuiltinViewConstants {
APPLICATION_LATENCIES,
AGGREGATION_WITH_MILLIS_HISTOGRAM,
ImmutableList.of(
- PROJECT_ID,
- INSTANCE_ID,
- APP_PROFILE,
- METHOD,
- STREAMING,
- CLIENT_NAME,
- CLUSTER,
- ZONE,
- TABLE));
+ PROJECT_ID, INSTANCE_ID, APP_PROFILE, METHOD, CLIENT_NAME, CLUSTER, ZONE, TABLE));
static final View THROTTLING_LATENCIES_VIEW =
View.create(
diff --git a/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/StatsRecorderWrapper.java b/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/StatsRecorderWrapper.java
index ff3568c5f4..eac556502d 100644
--- a/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/StatsRecorderWrapper.java
+++ b/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/StatsRecorderWrapper.java
@@ -40,7 +40,8 @@ public class StatsRecorderWrapper {
private final SpanName spanName;
private final Map statsAttributes;
- private MeasureMap measureMap;
+ private MeasureMap attemptMeasureMap;
+ private MeasureMap operationMeasureMap;
public StatsRecorderWrapper(
OperationType operationType,
@@ -54,10 +55,11 @@ public StatsRecorderWrapper(
this.parentContext = tagger.getCurrentTagContext();
this.statsAttributes = statsAttributes;
- this.measureMap = statsRecorder.newMeasureMap();
+ this.attemptMeasureMap = statsRecorder.newMeasureMap();
+ this.operationMeasureMap = statsRecorder.newMeasureMap();
}
- public void record(String status, String tableId, String zone, String cluster) {
+ public void recordOperation(String status, String tableId, String zone, String cluster) {
TagContextBuilder tagCtx =
newTagContextBuilder(tableId, zone, cluster)
.putLocal(BuiltinMeasureConstants.STATUS, TagValue.create(status));
@@ -66,39 +68,55 @@ public void record(String status, String tableId, String zone, String cluster) {
tagCtx.putLocal(
BuiltinMeasureConstants.STREAMING, TagValue.create(Boolean.toString(isStreaming)));
- measureMap.record(tagCtx.build());
+ operationMeasureMap.record(tagCtx.build());
+ // Reinitialize a new map
+ operationMeasureMap = statsRecorder.newMeasureMap();
+ }
+
+ public void recordAttempt(String status, String tableId, String zone, String cluster) {
+ TagContextBuilder tagCtx =
+ newTagContextBuilder(tableId, zone, cluster)
+ .putLocal(BuiltinMeasureConstants.STATUS, TagValue.create(status));
+
+ boolean isStreaming = operationType == OperationType.ServerStreaming;
+ tagCtx.putLocal(
+ BuiltinMeasureConstants.STREAMING, TagValue.create(Boolean.toString(isStreaming)));
+
+ attemptMeasureMap.record(tagCtx.build());
+ // Reinitialize a new map
+ attemptMeasureMap = statsRecorder.newMeasureMap();
}
public void putOperationLatencies(long operationLatency) {
- measureMap.put(BuiltinMeasureConstants.OPERATION_LATENCIES, operationLatency);
+ operationMeasureMap.put(BuiltinMeasureConstants.OPERATION_LATENCIES, operationLatency);
}
public void putAttemptLatencies(long attemptLatency) {
- measureMap.put(BuiltinMeasureConstants.ATTEMPT_LATENCIES, attemptLatency);
+ attemptMeasureMap.put(BuiltinMeasureConstants.ATTEMPT_LATENCIES, attemptLatency);
}
public void putRetryCount(int attemptCount) {
- measureMap.put(BuiltinMeasureConstants.RETRY_COUNT, attemptCount);
+ operationMeasureMap.put(BuiltinMeasureConstants.RETRY_COUNT, attemptCount);
}
public void putApplicationLatencies(long applicationLatency) {
- measureMap.put(BuiltinMeasureConstants.APPLICATION_LATENCIES, applicationLatency);
+ operationMeasureMap.put(BuiltinMeasureConstants.APPLICATION_LATENCIES, applicationLatency);
}
public void putFirstResponseLatencies(long firstResponseLatency) {
- measureMap.put(BuiltinMeasureConstants.FIRST_RESPONSE_LATENCIES, firstResponseLatency);
+ operationMeasureMap.put(BuiltinMeasureConstants.FIRST_RESPONSE_LATENCIES, firstResponseLatency);
}
public void putGfeLatencies(long serverLatency) {
- measureMap.put(BuiltinMeasureConstants.SERVER_LATENCIES, serverLatency);
+ attemptMeasureMap.put(BuiltinMeasureConstants.SERVER_LATENCIES, serverLatency);
}
public void putGfeMissingHeaders(long connectivityErrors) {
- measureMap.put(BuiltinMeasureConstants.CONNECTIVITY_ERROR_COUNT, connectivityErrors);
+ attemptMeasureMap.put(BuiltinMeasureConstants.CONNECTIVITY_ERROR_COUNT, connectivityErrors);
}
public void putBatchRequestThrottled(long throttledTimeMs) {
- measureMap.put(BuiltinMeasureConstants.THROTTLING_LATENCIES, throttledTimeMs);
+ operationMeasureMap.put(BuiltinMeasureConstants.THROTTLING_LATENCIES, throttledTimeMs);
}
private TagContextBuilder newTagContextBuilder(String tableId, String zone, String cluster) {
diff --git a/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/StatsWrapper.java b/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/StatsWrapper.java
index c30dba6e6c..401a1cf975 100644
--- a/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/StatsWrapper.java
+++ b/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/StatsWrapper.java
@@ -20,7 +20,10 @@
import com.google.api.core.InternalApi;
import com.google.api.gax.tracing.SpanName;
import io.opencensus.stats.Stats;
+import io.opencensus.stats.View;
+import io.opencensus.tags.TagKey;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@@ -31,7 +34,6 @@
*/
@InternalApi("For internal use only")
public class StatsWrapper {
-
public static StatsRecorderWrapper createRecorder(
OperationType operationType, SpanName spanName, Map statsAttributes) {
return new StatsRecorderWrapper(
@@ -49,4 +51,19 @@ public static List getOperationLatencyViewTagValueStrings() {
.map(x -> x.asString())
.collect(Collectors.toCollection(ArrayList::new));
}
+
+ // A workaround to run ITBuiltinViewConstantsTest as integration test. Integration test runs after
+ // the packaging step. Opencensus classes will be relocated when they are packaged but the
+ // integration test files will not be. So the integration tests can't reference any transitive
+ // dependencies that have been relocated.
+ static Map> getViewToTagMap() {
+ Map> map = new HashMap<>();
+ for (View view : BuiltinViews.BIGTABLE_BUILTIN_VIEWS) {
+ List tagKeys = view.getColumns();
+ map.put(
+ view.getName().asString(),
+ tagKeys.stream().map(tagKey -> tagKey.getName()).collect(Collectors.toList()));
+ }
+ return map;
+ }
}
diff --git a/google-cloud-bigtable-stats/src/main/resources/META-INF/license/apache2-LICENSE.txt b/google-cloud-bigtable-stats/src/main/resources/META-INF/license/apache2-LICENSE.txt
new file mode 100644
index 0000000000..261eeb9e9f
--- /dev/null
+++ b/google-cloud-bigtable-stats/src/main/resources/META-INF/license/apache2-LICENSE.txt
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/google-cloud-bigtable-stats/src/test/java/com/google/cloud/bigtable/stats/BigtableCreateTimeSeriesExporterTest.java b/google-cloud-bigtable-stats/src/test/java/com/google/cloud/bigtable/stats/BigtableCreateTimeSeriesExporterTest.java
new file mode 100644
index 0000000000..26654c09af
--- /dev/null
+++ b/google-cloud-bigtable-stats/src/test/java/com/google/cloud/bigtable/stats/BigtableCreateTimeSeriesExporterTest.java
@@ -0,0 +1,148 @@
+/*
+ * Copyright 2021 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.google.cloud.bigtable.stats;
+
+import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import com.google.api.MonitoredResource;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.monitoring.v3.MetricServiceClient;
+import com.google.cloud.monitoring.v3.stub.MetricServiceStub;
+import com.google.monitoring.v3.CreateTimeSeriesRequest;
+import com.google.protobuf.Empty;
+import io.opencensus.common.Timestamp;
+import io.opencensus.metrics.LabelKey;
+import io.opencensus.metrics.LabelValue;
+import io.opencensus.metrics.export.Metric;
+import io.opencensus.metrics.export.MetricDescriptor;
+import io.opencensus.metrics.export.Point;
+import io.opencensus.metrics.export.TimeSeries;
+import io.opencensus.metrics.export.Value;
+import java.util.Arrays;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnit;
+import org.mockito.junit.MockitoRule;
+
+@RunWith(JUnit4.class)
+public class BigtableCreateTimeSeriesExporterTest {
+
+ private static final String projectId = "fake-project";
+ private static final String instanceId = "fake-instance";
+ private static final String appProfileId = "default";
+ private static final String tableId = "fake-table";
+ private static final String zone = "us-east-1";
+ private static final String cluster = "cluster-1";
+
+ @Rule public final MockitoRule mockitoRule = MockitoJUnit.rule();
+
+ @Mock private MetricServiceStub mockMetricServiceStub;
+ private MetricServiceClient fakeMetricServiceClient;
+ private BigtableCreateTimeSeriesExporter exporter;
+
+ @Before
+ public void setUp() {
+
+ fakeMetricServiceClient = new FakeMetricServiceClient(mockMetricServiceStub);
+
+ exporter =
+ new BigtableCreateTimeSeriesExporter(
+ fakeMetricServiceClient,
+ MonitoredResource.newBuilder().setType("bigtable-table").build());
+ }
+
+ @After
+ public void tearDown() {}
+
+ @Test
+ public void testTimeSeries() {
+ ArgumentCaptor argumentCaptor =
+ ArgumentCaptor.forClass(CreateTimeSeriesRequest.class);
+
+ UnaryCallable mockCallable = mock(UnaryCallable.class);
+ when(mockMetricServiceStub.createServiceTimeSeriesCallable()).thenReturn(mockCallable);
+ when(mockCallable.call(argumentCaptor.capture())).thenReturn(Empty.getDefaultInstance());
+
+ double fakeValue = 10.0;
+ Metric fakeMetric =
+ Metric.create(
+ MetricDescriptor.create(
+ "bigtable/test",
+ "descritpion",
+ "ms",
+ MetricDescriptor.Type.CUMULATIVE_DOUBLE,
+ Arrays.asList(
+ LabelKey.create(BuiltinMeasureConstants.PROJECT_ID.getName(), ""),
+ LabelKey.create(BuiltinMeasureConstants.INSTANCE_ID.getName(), ""),
+ LabelKey.create(BuiltinMeasureConstants.TABLE.getName(), ""),
+ LabelKey.create(BuiltinMeasureConstants.CLUSTER.getName(), ""),
+ LabelKey.create(BuiltinMeasureConstants.ZONE.getName(), ""),
+ LabelKey.create(BuiltinMeasureConstants.APP_PROFILE.getName(), ""))),
+ Arrays.asList(
+ TimeSeries.create(
+ Arrays.asList(
+ LabelValue.create(projectId),
+ LabelValue.create(instanceId),
+ LabelValue.create(tableId),
+ LabelValue.create(cluster),
+ LabelValue.create(zone),
+ LabelValue.create(appProfileId)),
+ Arrays.asList(
+ Point.create(
+ Value.doubleValue(fakeValue),
+ Timestamp.fromMillis(System.currentTimeMillis()))),
+ Timestamp.fromMillis(System.currentTimeMillis()))));
+
+ exporter.export(Arrays.asList(fakeMetric));
+
+ CreateTimeSeriesRequest request = argumentCaptor.getValue();
+
+ assertThat(request.getTimeSeriesList()).hasSize(1);
+
+ com.google.monitoring.v3.TimeSeries timeSeries = request.getTimeSeriesList().get(0);
+
+ assertThat(timeSeries.getResource().getLabelsMap())
+ .containsExactly(
+ BuiltinMeasureConstants.PROJECT_ID.getName(), projectId,
+ BuiltinMeasureConstants.INSTANCE_ID.getName(), instanceId,
+ BuiltinMeasureConstants.TABLE.getName(), tableId,
+ BuiltinMeasureConstants.CLUSTER.getName(), cluster,
+ BuiltinMeasureConstants.ZONE.getName(), zone);
+
+ assertThat(timeSeries.getMetric().getLabelsMap()).hasSize(2);
+ assertThat(timeSeries.getMetric().getLabelsMap())
+ .containsAtLeast(BuiltinMeasureConstants.APP_PROFILE.getName(), appProfileId);
+ assertThat(timeSeries.getMetric().getLabelsMap())
+ .containsKey(BuiltinMeasureConstants.CLIENT_UID.getName());
+
+ assertThat(timeSeries.getPoints(0).getValue().getDoubleValue()).isEqualTo(fakeValue);
+ }
+
+ private class FakeMetricServiceClient extends MetricServiceClient {
+
+ protected FakeMetricServiceClient(MetricServiceStub stub) {
+ super(stub);
+ }
+ }
+}
diff --git a/google-cloud-bigtable-stats/src/test/java/com/google/cloud/bigtable/stats/BuiltinViewConstantsTest.java b/google-cloud-bigtable-stats/src/test/java/com/google/cloud/bigtable/stats/ITBuiltinViewConstantsTest.java
similarity index 59%
rename from google-cloud-bigtable-stats/src/test/java/com/google/cloud/bigtable/stats/BuiltinViewConstantsTest.java
rename to google-cloud-bigtable-stats/src/test/java/com/google/cloud/bigtable/stats/ITBuiltinViewConstantsTest.java
index a7d20f6da1..929ee85f48 100644
--- a/google-cloud-bigtable-stats/src/test/java/com/google/cloud/bigtable/stats/BuiltinViewConstantsTest.java
+++ b/google-cloud-bigtable-stats/src/test/java/com/google/cloud/bigtable/stats/ITBuiltinViewConstantsTest.java
@@ -17,23 +17,22 @@
import static com.google.common.truth.Truth.assertWithMessage;
-import io.opencensus.stats.View;
+import java.util.List;
+import java.util.Map;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
-public class BuiltinViewConstantsTest {
+@RunWith(JUnit4.class)
+public class ITBuiltinViewConstantsTest {
@Test
public void testBasicTagsExistForAllViews() {
- for (View v : BuiltinViews.BIGTABLE_BUILTIN_VIEWS) {
- assertWithMessage(v.getName() + " should have all basic tags")
- .that(v.getColumns())
+ Map> viewToTagMap = StatsWrapper.getViewToTagMap();
+ for (String view : viewToTagMap.keySet()) {
+ assertWithMessage(view + " should have all basic tags")
+ .that(viewToTagMap.get(view))
.containsAtLeast(
- BuiltinMeasureConstants.PROJECT_ID,
- BuiltinMeasureConstants.INSTANCE_ID,
- BuiltinMeasureConstants.APP_PROFILE,
- BuiltinMeasureConstants.METHOD,
- BuiltinMeasureConstants.ZONE,
- BuiltinMeasureConstants.CLUSTER,
- BuiltinMeasureConstants.TABLE);
+ "project_id", "instance", "app_profile", "method", "zone", "cluster", "table");
}
}
}
diff --git a/google-cloud-bigtable-stats/src/test/java/com/google/cloud/bigtable/stats/StatsRecorderWrapperTest.java b/google-cloud-bigtable-stats/src/test/java/com/google/cloud/bigtable/stats/StatsRecorderWrapperTest.java
index ed67472623..a878fc96da 100644
--- a/google-cloud-bigtable-stats/src/test/java/com/google/cloud/bigtable/stats/StatsRecorderWrapperTest.java
+++ b/google-cloud-bigtable-stats/src/test/java/com/google/cloud/bigtable/stats/StatsRecorderWrapperTest.java
@@ -34,7 +34,14 @@
import java.util.Objects;
import org.junit.Before;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+// Can only be run as a unit test. Opencensus classes will be relocated when they are packaged but
+// the integration test files will not be. So the integration tests can't reference any transitive
+// dependencies that have been relocated. To work around this, we'll have to move all the reference
+// to opencensus to StatsWrapper.
+@RunWith(JUnit4.class)
public class StatsRecorderWrapperTest {
private final String PROJECT_ID = "fake-project";
@@ -86,7 +93,8 @@ public void testStreamingOperation() throws InterruptedException {
recorderWrapper.putFirstResponseLatencies(firstResponseLatency);
recorderWrapper.putBatchRequestThrottled(throttlingLatency);
- recorderWrapper.record("OK", TABLE_ID, ZONE, CLUSTER);
+ recorderWrapper.recordOperation("OK", TABLE_ID, ZONE, CLUSTER);
+ recorderWrapper.recordAttempt("OK", TABLE_ID, ZONE, CLUSTER);
Thread.sleep(100);
@@ -284,7 +292,8 @@ public void testUnaryOperations() throws InterruptedException {
recorderWrapper.putFirstResponseLatencies(firstResponseLatency);
recorderWrapper.putBatchRequestThrottled(throttlingLatency);
- recorderWrapper.record("UNAVAILABLE", TABLE_ID, ZONE, CLUSTER);
+ recorderWrapper.recordOperation("UNAVAILABLE", TABLE_ID, ZONE, CLUSTER);
+ recorderWrapper.recordAttempt("UNAVAILABLE", TABLE_ID, ZONE, CLUSTER);
Thread.sleep(100);
diff --git a/google-cloud-bigtable/clirr-ignored-differences.xml b/google-cloud-bigtable/clirr-ignored-differences.xml
index 3fa8f3ee1e..80d3d22703 100644
--- a/google-cloud-bigtable/clirr-ignored-differences.xml
+++ b/google-cloud-bigtable/clirr-ignored-differences.xml
@@ -76,4 +76,9 @@
8001
com/google/cloud/bigtable/data/v2/stub/metrics/HeaderTracerUnaryCallable
+
+
+ 8001
+ com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsConvertExceptionCallable
+
diff --git a/google-cloud-bigtable/pom.xml b/google-cloud-bigtable/pom.xml
index 1ad646c868..487dfeadf8 100644
--- a/google-cloud-bigtable/pom.xml
+++ b/google-cloud-bigtable/pom.xml
@@ -2,7 +2,7 @@
4.0.0
google-cloud-bigtable
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
jar
Google Cloud Bigtable
https://github.com/googleapis/java-bigtable
@@ -12,11 +12,11 @@
com.google.cloud
google-cloud-bigtable-parent
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
google-cloud-bigtable
@@ -47,14 +47,21 @@
com.google.cloud
google-cloud-bigtable-deps-bom
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
pom
import
com.google.cloud
google-cloud-bigtable-bom
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
+ pom
+ import
+
+
+ com.google.cloud
+ google-cloud-monitoring-bom
+ 3.4.2
pom
import
@@ -64,10 +71,18 @@
-
com.google.cloud
google-cloud-bigtable-stats
+
+
+
+ io.opencensus
+ *
+
+
@@ -129,10 +144,12 @@
com.google.http-client
google-http-client
+ runtime
com.google.http-client
google-http-client-gson
+ runtime
com.google.protobuf
@@ -151,6 +168,17 @@
grpc-alts
runtime
+
+
+ com.google.http-client
+ google-http-client
+ runtime
+
+
+ com.google.http-client
+ google-http-client-gson
+ runtime
+
+ 2.11.2-SNAPSHOT
grpc-google-cloud-bigtable-admin-v2
GRPC library for grpc-google-cloud-bigtable-admin-v2
com.google.cloud
google-cloud-bigtable-parent
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
@@ -18,14 +18,14 @@
com.google.cloud
google-cloud-bigtable-deps-bom
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
pom
import
com.google.cloud
google-cloud-bigtable-bom
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
pom
import
@@ -74,7 +74,7 @@
org.apache.maven.plugins
maven-javadoc-plugin
- 3.4.0
+ 3.4.1
protected
true
diff --git a/grpc-google-cloud-bigtable-v2/pom.xml b/grpc-google-cloud-bigtable-v2/pom.xml
index 3928b491d2..7bd61241d7 100644
--- a/grpc-google-cloud-bigtable-v2/pom.xml
+++ b/grpc-google-cloud-bigtable-v2/pom.xml
@@ -4,13 +4,13 @@
4.0.0
com.google.api.grpc
grpc-google-cloud-bigtable-v2
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
grpc-google-cloud-bigtable-v2
GRPC library for grpc-google-cloud-bigtable-v2
com.google.cloud
google-cloud-bigtable-parent
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
@@ -18,14 +18,14 @@
com.google.cloud
google-cloud-bigtable-deps-bom
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
pom
import
com.google.cloud
google-cloud-bigtable-bom
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
pom
import
@@ -66,7 +66,7 @@
org.apache.maven.plugins
maven-javadoc-plugin
- 3.4.0
+ 3.4.1
protected
true
diff --git a/pom.xml b/pom.xml
index 7ae4cba9c6..2333898f24 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
google-cloud-bigtable-parent
pom
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
Google Cloud Bigtable Parent
https://github.com/googleapis/java-bigtable
@@ -14,7 +14,8 @@
com.google.cloud
google-cloud-shared-config
- 1.5.1
+ 1.5.3
+
@@ -152,33 +153,33 @@
com.google.api.grpc
proto-google-cloud-bigtable-v2
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
com.google.api.grpc
proto-google-cloud-bigtable-admin-v2
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
com.google.api.grpc
grpc-google-cloud-bigtable-v2
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
com.google.api.grpc
grpc-google-cloud-bigtable-admin-v2
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
com.google.cloud
google-cloud-bigtable
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
com.google.cloud
google-cloud-conformance-tests
- 0.3.0
+ 0.3.4
com.google.truth
@@ -206,7 +207,7 @@
org.mockito
mockito-core
- 4.6.1
+ 4.7.0
@@ -225,7 +226,7 @@
org.apache.maven.plugins
maven-javadoc-plugin
- 3.4.0
+ 3.4.1
aggregate
@@ -315,7 +316,7 @@
org.apache.maven.plugins
maven-javadoc-plugin
- 3.4.0
+ 3.4.1
com.microsoft.doclet.DocFxDoclet
false
@@ -339,6 +340,22 @@
+
+
+
+ with-shaded
+
+
+ !skip-shaded
+
+
+
+ google-cloud-bigtable-stats
+
+
@@ -347,7 +364,6 @@
grpc-google-cloud-bigtable-v2
proto-google-cloud-bigtable-admin-v2
proto-google-cloud-bigtable-v2
- google-cloud-bigtable-stats
google-cloud-bigtable-emulator-core
google-cloud-bigtable-emulator
google-cloud-bigtable-bom
diff --git a/proto-google-cloud-bigtable-admin-v2/pom.xml b/proto-google-cloud-bigtable-admin-v2/pom.xml
index efb09e165d..721dee46f3 100644
--- a/proto-google-cloud-bigtable-admin-v2/pom.xml
+++ b/proto-google-cloud-bigtable-admin-v2/pom.xml
@@ -4,13 +4,13 @@
4.0.0
com.google.api.grpc
proto-google-cloud-bigtable-admin-v2
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
proto-google-cloud-bigtable-admin-v2
PROTO library for proto-google-cloud-bigtable-admin-v2
com.google.cloud
google-cloud-bigtable-parent
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
@@ -18,14 +18,14 @@
com.google.cloud
google-cloud-bigtable-deps-bom
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
pom
import
com.google.cloud
google-cloud-bigtable-bom
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
pom
import
diff --git a/proto-google-cloud-bigtable-v2/pom.xml b/proto-google-cloud-bigtable-v2/pom.xml
index 2d1e82fed6..42f7b20c96 100644
--- a/proto-google-cloud-bigtable-v2/pom.xml
+++ b/proto-google-cloud-bigtable-v2/pom.xml
@@ -4,13 +4,13 @@
4.0.0
com.google.api.grpc
proto-google-cloud-bigtable-v2
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
proto-google-cloud-bigtable-v2
PROTO library for proto-google-cloud-bigtable-v2
com.google.cloud
google-cloud-bigtable-parent
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
@@ -18,14 +18,14 @@
com.google.cloud
google-cloud-bigtable-deps-bom
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
pom
import
com.google.cloud
google-cloud-bigtable-bom
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
pom
import
diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml
index 088afd3126..0684cdc321 100644
--- a/samples/install-without-bom/pom.xml
+++ b/samples/install-without-bom/pom.xml
@@ -29,7 +29,7 @@
com.google.cloud
google-cloud-bigtable
- 2.9.0
+ 2.11.1
diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml
index 861190f078..6fc55d073d 100644
--- a/samples/native-image-sample/pom.xml
+++ b/samples/native-image-sample/pom.xml
@@ -29,7 +29,7 @@
com.google.cloud
libraries-bom
- 25.4.0
+ 26.1.1
pom
import
@@ -83,13 +83,13 @@
org.junit.vintage
junit-vintage-engine
- 5.8.2
+ 5.9.0
test
org.graalvm.buildtools
junit-platform-native
- 0.9.12
+ 0.9.13
test
@@ -99,7 +99,7 @@
org.graalvm.buildtools
native-maven-plugin
- 0.9.12
+ 0.9.13
true
com.example.bigtable.NativeImageBigtableSample
diff --git a/samples/pom.xml b/samples/pom.xml
index 660f67d35b..4254f54811 100644
--- a/samples/pom.xml
+++ b/samples/pom.xml
@@ -39,7 +39,7 @@
org.apache.maven.plugins
maven-deploy-plugin
- 2.8.2
+ 3.0.0
true
diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml
index ee6a0e9bfb..d5a74eb608 100644
--- a/samples/snapshot/pom.xml
+++ b/samples/snapshot/pom.xml
@@ -28,7 +28,7 @@
com.google.cloud
google-cloud-bigtable
- 2.9.1-SNAPSHOT
+ 2.11.2-SNAPSHOT
diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml
index 9b5e24c2e7..b75c4c14c8 100644
--- a/samples/snippets/pom.xml
+++ b/samples/snippets/pom.xml
@@ -30,7 +30,7 @@
com.google.cloud
libraries-bom
- 25.4.0
+ 26.1.1
pom
import
diff --git a/versions.txt b/versions.txt
index 8aa7370dcd..ff186e3606 100644
--- a/versions.txt
+++ b/versions.txt
@@ -1,10 +1,10 @@
# Format:
# module:released-version:current-version
-google-cloud-bigtable:2.9.0:2.9.1-SNAPSHOT
-grpc-google-cloud-bigtable-admin-v2:2.9.0:2.9.1-SNAPSHOT
-grpc-google-cloud-bigtable-v2:2.9.0:2.9.1-SNAPSHOT
-proto-google-cloud-bigtable-admin-v2:2.9.0:2.9.1-SNAPSHOT
-proto-google-cloud-bigtable-v2:2.9.0:2.9.1-SNAPSHOT
-google-cloud-bigtable-emulator:0.146.0:0.146.1-SNAPSHOT
-google-cloud-bigtable-emulator-core:2.9.0:2.9.1-SNAPSHOT
+google-cloud-bigtable:2.11.1:2.11.2-SNAPSHOT
+grpc-google-cloud-bigtable-admin-v2:2.11.1:2.11.2-SNAPSHOT
+grpc-google-cloud-bigtable-v2:2.11.1:2.11.2-SNAPSHOT
+proto-google-cloud-bigtable-admin-v2:2.11.1:2.11.2-SNAPSHOT
+proto-google-cloud-bigtable-v2:2.11.1:2.11.2-SNAPSHOT
+google-cloud-bigtable-emulator:0.148.1:0.148.2-SNAPSHOT
+google-cloud-bigtable-emulator-core:2.11.1:2.11.2-SNAPSHOT