Repository: googleapis/java-datastore
Pull request #1886 (2025-06-17 22:30:39)

feat: enable grpc configurator for client-side tracing
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
- [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/java-datastore/issues/new/choose) before writing your code!  That way we can discuss the change, evaluate designs, and agree on the general idea
- [ ] Ensure the tests and linter pass
- [ ] Code coverage does not decrease (if any source code was changed)
- [ ] Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> ☕️

If you write sample code, please follow the [samples format](
https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md).



Patch:
diff --git a/datastore-v1-proto-client/pom.xml b/datastore-v1-proto-client/pom.xml
index 50210ebe..6a573df0 100644
--- a/datastore-v1-proto-client/pom.xml
+++ b/datastore-v1-proto-client/pom.xml
@@ -19,15 +19,16 @@
   <modelVersion>4.0.0</modelVersion>
   <groupId>com.google.cloud.datastore</groupId>
   <artifactId>datastore-v1-proto-client</artifactId>
-  <version>2.29.2</version><!-- {x-version-update:datastore-v1-proto-client:current} -->
+  <version>2.29.3-SNAPSHOT</version><!-- {x-version-update:datastore-v1-proto-client:current} -->
 
   <parent>
     <groupId>com.google.cloud</groupId>
     <artifactId>google-cloud-datastore-parent</artifactId>
-    <version>2.29.2</version><!-- {x-version-update:google-cloud-datastore:current} -->
+    <version>2.29.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-datastore:current} -->
   </parent>
 
   <packaging>jar</packaging>
+  <name>datastore-v1-proto-client</name>
   <description>
     Low level client for accessing Google Cloud Datastore v1.
   </description>
diff --git a/google-cloud-datastore-bom/pom.xml b/google-cloud-datastore-bom/pom.xml
index edc225e4..7f954626 100644
--- a/google-cloud-datastore-bom/pom.xml
+++ b/google-cloud-datastore-bom/pom.xml
@@ -3,7 +3,7 @@
   <modelVersion>4.0.0</modelVersion>
   <groupId>com.google.cloud</groupId>
   <artifactId>google-cloud-datastore-bom</artifactId>
-  <version>2.29.2</version><!-- {x-version-update:google-cloud-datastore-bom:current} -->
+  <version>2.29.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-datastore-bom:current} -->
   <packaging>pom</packaging>
   <parent>
     <groupId>com.google.cloud</groupId>
@@ -52,22 +52,22 @@
       <dependency>
         <groupId>com.google.cloud</groupId>
         <artifactId>google-cloud-datastore</artifactId>
-        <version>2.29.2</version><!-- {x-version-update:google-cloud-datastore:current} -->
+        <version>2.29.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-datastore:current} -->
       </dependency>
       <dependency>
         <groupId>com.google.api.grpc</groupId>
         <artifactId>grpc-google-cloud-datastore-admin-v1</artifactId>
-        <version>2.29.2</version><!-- {x-version-update:grpc-google-cloud-datastore-admin-v1:current} -->
+        <version>2.29.3-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-datastore-admin-v1:current} -->
       </dependency>
       <dependency>
         <groupId>com.google.api.grpc</groupId>
         <artifactId>proto-google-cloud-datastore-v1</artifactId>
-        <version>0.120.2</version><!-- {x-version-update:proto-google-cloud-datastore-v1:current} -->
+        <version>0.120.3-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-datastore-v1:current} -->
       </dependency>
       <dependency>
         <groupId>com.google.api.grpc</groupId>
         <artifactId>proto-google-cloud-datastore-admin-v1</artifactId>
-        <version>2.29.2</version><!-- {x-version-update:proto-google-cloud-datastore-admin-v1:current} -->
+        <version>2.29.3-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-datastore-admin-v1:current} -->
       </dependency>
     </dependencies>
   </dependencyManagement>
diff --git a/google-cloud-datastore-utils/pom.xml b/google-cloud-datastore-utils/pom.xml
index 90af8cfe..95c42e0e 100644
--- a/google-cloud-datastore-utils/pom.xml
+++ b/google-cloud-datastore-utils/pom.xml
@@ -3,7 +3,7 @@
     <modelVersion>4.0.0</modelVersion>
     <groupId>com.google.cloud</groupId>
     <artifactId>google-cloud-datastore-utils</artifactId>
-    <version>2.29.2</version><!-- {x-version-update:google-cloud-datastore:current} -->
+    <version>2.29.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-datastore:current} -->
     <packaging>jar</packaging>
     <name>Google Cloud Datastore Utilities</name>
     <url>https://github.com/googleapis/java-datastore</url>
@@ -13,7 +13,7 @@
     <parent>
         <groupId>com.google.cloud</groupId>
         <artifactId>google-cloud-datastore-parent</artifactId>
-        <version>2.29.2</version><!-- {x-version-update:google-cloud-datastore:current} -->
+        <version>2.29.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-datastore:current} -->
     </parent>
     <properties>
         <site.installationModule>google-cloud-datastore-utils</site.installationModule>
diff --git a/google-cloud-datastore/pom.xml b/google-cloud-datastore/pom.xml
index 19e045cc..ea1dc0e6 100644
--- a/google-cloud-datastore/pom.xml
+++ b/google-cloud-datastore/pom.xml
@@ -2,7 +2,7 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <artifactId>google-cloud-datastore</artifactId>
-  <version>2.29.2</version><!-- {x-version-update:google-cloud-datastore:current} -->
+  <version>2.29.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-datastore:current} -->
   <packaging>jar</packaging>
   <name>Google Cloud Datastore</name>
   <url>https://github.com/googleapis/java-datastore</url>
@@ -12,7 +12,7 @@
   <parent>
     <groupId>com.google.cloud</groupId>
     <artifactId>google-cloud-datastore-parent</artifactId>
-    <version>2.29.2</version><!-- {x-version-update:google-cloud-datastore:current} -->
+    <version>2.29.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-datastore:current} -->
   </parent>
   <properties>
     <site.installationModule>google-cloud-datastore</site.installationModule>
@@ -147,6 +147,10 @@
       <artifactId>opentelemetry-context</artifactId>
       <version>${opentelemetry.version}</version>
     </dependency>
+    <dependency>
+      <groupId>io.opentelemetry.instrumentation</groupId>
+      <artifactId>opentelemetry-grpc-1.6</artifactId>
+    </dependency>
     <!-- END OpenTelemetry -->
 
     <!-- Test dependencies -->
diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreOptions.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreOptions.java
index 1ea79298..242ce3b0 100644
--- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreOptions.java
+++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreOptions.java
@@ -18,6 +18,7 @@ package com.google.cloud.datastore;
 
 import static com.google.cloud.datastore.Validator.validateNamespace;
 
+import com.google.api.core.ApiFunction;
 import com.google.api.core.BetaApi;
 import com.google.api.gax.grpc.ChannelPoolSettings;
 import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
@@ -35,6 +36,7 @@ import com.google.cloud.grpc.GrpcTransportOptions;
 import com.google.cloud.http.HttpTransportOptions;
 import com.google.common.base.MoreObjects;
 import com.google.common.collect.ImmutableSet;
+import io.grpc.ManagedChannelBuilder;
 import java.io.IOException;
 import java.lang.reflect.Method;
 import java.util.Objects;
@@ -222,20 +224,37 @@ public class DatastoreOptions extends ServiceOptions<Datastore, DatastoreOptions
       throw new IllegalArgumentException(
           "Only gRPC transport allows setting of channel provider or credentials provider");
     } else if (getTransportOptions() instanceof GrpcTransportOptions) {
-      // For grpc transport options, configure default gRPC Connection pool with minChannelCount = 1
-      // and maxChannelCount = 4
-      this.channelProvider =
-          builder.channelProvider != null
-              ? builder.channelProvider
-              : GrpcTransportOptions.setUpChannelProvider(
+      if (builder.channelProvider == null) {
+        /*
+         The default gRPC connection pool is configured with a minimum of 1 channel.
+         The maximum channel count automatically defaults to 200 (Defined in gax-grpc).
+        */
+        ChannelPoolSettings datastoreChannelPoolSettings =
+            ChannelPoolSettings.builder()
+                .setInitialChannelCount(INIT_CHANNEL_COUNT)
+                .setMinChannelCount(MIN_CHANNEL_COUNT)
+                .build();
+
+        ApiFunction<ManagedChannelBuilder, ManagedChannelBuilder> channelConfigurator =
+            this.traceUtil.getChannelConfigurator();
+        if (channelConfigurator == null) {
+          this.channelProvider =
+              GrpcTransportOptions.setUpChannelProvider(
                   DatastoreSettings.defaultGrpcTransportProviderBuilder()
-                      .setChannelPoolSettings(
-                          ChannelPoolSettings.builder()
-                              .setInitialChannelCount(INIT_CHANNEL_COUNT)
-                              .setMinChannelCount(MIN_CHANNEL_COUNT)
-                              .setMaxChannelCount(MAX_CHANNEL_COUNT)
-                              .build()),
+                      .setChannelPoolSettings(datastoreChannelPoolSettings),
                   this);
+        } else {
+          // Intercept the grpc channel calls to add telemetry info.
+          this.channelProvider =
+              GrpcTransportOptions.setUpChannelProvider(
+                  DatastoreSettings.defaultGrpcTransportProviderBuilder()
+                      .setChannelPoolSettings(datastoreChannelPoolSettings)
+                      .setChannelConfigurator(channelConfigurator),
+                  this);
+        }
+      } else {
+        this.channelProvider = builder.channelProvider;
+      }
     }
   }
 
@@ -256,6 +275,7 @@ public class DatastoreOptions extends ServiceOptions<Datastore, DatastoreOptions
   }
 
   private static class DatastoreDefaults implements ServiceDefaults<Datastore, DatastoreOptions> {
+
     private final TransportOptions TRANSPORT_OPTIONS = getDefaultTransportOptionsBuilder().build();
 
     @Override
diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/spi/v1/GrpcDatastoreRpc.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/spi/v1/GrpcDatastoreRpc.java
index ea9043bb..f9e3a34f 100644
--- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/spi/v1/GrpcDatastoreRpc.java
+++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/spi/v1/GrpcDatastoreRpc.java
@@ -75,7 +75,7 @@ public class GrpcDatastoreRpc implements DatastoreRpc {
               ? getClientContextForEmulator(datastoreOptions)
               : getClientContext(datastoreOptions);
 
-      /* For grpc transport options, configure default gRPC Connection pool with minChannelCount = 1 and maxChannelCount = 4 */
+      /* For grpc transport options, configure default gRPC Connection pool with minChannelCount = 1 */
       DatastoreStubSettings datastoreStubSettings =
           DatastoreStubSettings.newBuilder(clientContext)
               .applyToAllUnaryMethods(retrySettingSetter(datastoreOptions))
@@ -85,7 +85,6 @@ public class GrpcDatastoreRpc implements DatastoreRpc {
                           ChannelPoolSettings.builder()
                               .setInitialChannelCount(DatastoreOptions.INIT_CHANNEL_COUNT)
                               .setMinChannelCount(DatastoreOptions.MIN_CHANNEL_COUNT)
-                              .setMaxChannelCount(DatastoreOptions.MAX_CHANNEL_COUNT)
                               .build())
                       .build())
               .build();
diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/telemetry/EnabledTraceUtil.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/telemetry/EnabledTraceUtil.java
index 40fc7308..711e9402 100644
--- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/telemetry/EnabledTraceUtil.java
+++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/telemetry/EnabledTraceUtil.java
@@ -35,6 +35,8 @@ import io.opentelemetry.api.trace.SpanBuilder;
 import io.opentelemetry.api.trace.SpanKind;
 import io.opentelemetry.api.trace.StatusCode;
 import io.opentelemetry.api.trace.Tracer;
+import io.opentelemetry.api.trace.TracerProvider;
+import io.opentelemetry.instrumentation.grpc.v1_6.GrpcTelemetry;
 import java.util.Map;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
@@ -66,14 +68,30 @@ public class EnabledTraceUtil implements TraceUtil {
     return openTelemetry;
   }
 
+  // The gRPC channel configurator that intercepts gRPC calls for tracing purposes.
+  public class OpenTelemetryGrpcChannelConfigurator
+      implements ApiFunction<ManagedChannelBuilder, ManagedChannelBuilder> {
+
+    @Override
+    public ManagedChannelBuilder apply(ManagedChannelBuilder managedChannelBuilder) {
+      GrpcTelemetry grpcTelemetry = GrpcTelemetry.create(getOpenTelemetry());
+      return managedChannelBuilder.intercept(grpcTelemetry.newClientInterceptor());
+    }
+  }
+
   @Override
   @Nullable
   public ApiFunction<ManagedChannelBuilder, ManagedChannelBuilder> getChannelConfigurator() {
-    // TODO(jimit) Update this to return a gRPC Channel Configurator after gRPC upgrade.
-    return null;
+    // Note: using `==` rather than `.equals` since OpenTelemetry has only 1 static instance of
+    // `TracerProvider.noop`.
+    if (openTelemetry.getTracerProvider() == TracerProvider.noop()) {
+      return null;
+    }
+    return new OpenTelemetryGrpcChannelConfigurator();
   }
 
   static class Span implements TraceUtil.Span {
+
     private final io.opentelemetry.api.trace.Span span;
     private final String spanName;
 
@@ -198,6 +216,7 @@ public class EnabledTraceUtil implements TraceUtil {
   }
 
   static class Scope implements TraceUtil.Scope {
+
     private final io.opentelemetry.context.Scope scope;
 
     Scope(io.opentelemetry.context.Scope scope) {
@@ -211,6 +230,7 @@ public class EnabledTraceUtil implements TraceUtil {
   }
 
   static class Context implements TraceUtil.Context {
+
     private final io.opentelemetry.context.Context context;
 
     Context(io.opentelemetry.context.Context context) {
diff --git a/grpc-google-cloud-datastore-admin-v1/pom.xml b/grpc-google-cloud-datastore-admin-v1/pom.xml
index 1e218b92..c6e0e90f 100644
--- a/grpc-google-cloud-datastore-admin-v1/pom.xml
+++ b/grpc-google-cloud-datastore-admin-v1/pom.xml
@@ -4,13 +4,13 @@
   <modelVersion>4.0.0</modelVersion>
   <groupId>com.google.api.grpc</groupId>
   <artifactId>grpc-google-cloud-datastore-admin-v1</artifactId>
-  <version>2.29.2</version><!-- {x-version-update:grpc-google-cloud-datastore-admin-v1:current} -->
+  <version>2.29.3-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-datastore-admin-v1:current} -->
   <name>grpc-google-cloud-datastore-admin-v1</name>
   <description>GRPC library for google-cloud-datastore</description>
   <parent>
     <groupId>com.google.cloud</groupId>
     <artifactId>google-cloud-datastore-parent</artifactId>
-    <version>2.29.2</version><!-- {x-version-update:google-cloud-datastore:current} -->
+    <version>2.29.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-datastore:current} -->
   </parent>
   <dependencies>
     <dependency>
diff --git a/grpc-google-cloud-datastore-v1/pom.xml b/grpc-google-cloud-datastore-v1/pom.xml
index b29600f4..291507cf 100644
--- a/grpc-google-cloud-datastore-v1/pom.xml
+++ b/grpc-google-cloud-datastore-v1/pom.xml
@@ -4,13 +4,13 @@
   <modelVersion>4.0.0</modelVersion>
   <groupId>com.google.api.grpc</groupId>
   <artifactId>grpc-google-cloud-datastore-v1</artifactId>
-  <version>2.29.2</version><!-- {x-version-update:grpc-google-cloud-datastore-v1:current} -->
+  <version>2.29.3-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-datastore-v1:current} -->
   <name>grpc-google-cloud-datastore-v1</name>
   <description>GRPC library for google-cloud-datastore</description>
   <parent>
     <groupId>com.google.cloud</groupId>
     <artifactId>google-cloud-datastore-parent</artifactId>
-    <version>2.29.2</version><!-- {x-version-update:google-cloud-datastore:current} -->
+    <version>2.29.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-datastore:current} -->
   </parent>
   <dependencies>
     <dependency>
diff --git a/pom.xml b/pom.xml
index bef877d0..d274626d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
   <groupId>com.google.cloud</groupId>
   <artifactId>google-cloud-datastore-parent</artifactId>
   <packaging>pom</packaging>
-  <version>2.29.2</version><!-- {x-version-update:google-cloud-datastore:current} -->
+  <version>2.29.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-datastore:current} -->
   <name>Google Cloud Datastore Parent</name>
   <url>https://github.com/googleapis/java-datastore</url>
   <description>
@@ -159,27 +159,27 @@
       <dependency>
         <groupId>com.google.api.grpc</groupId>
         <artifactId>proto-google-cloud-datastore-admin-v1</artifactId>
-        <version>2.29.2</version><!-- {x-version-update:proto-google-cloud-datastore-admin-v1:current} -->
+        <version>2.29.3-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-datastore-admin-v1:current} -->
       </dependency>
       <dependency>
         <groupId>com.google.api.grpc</groupId>
         <artifactId>grpc-google-cloud-datastore-admin-v1</artifactId>
-        <version>2.29.2</version><!-- {x-version-update:grpc-google-cloud-datastore-admin-v1:current} -->
+        <version>2.29.3-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-datastore-admin-v1:current} -->
       </dependency>
       <dependency>
         <groupId>com.google.cloud</groupId>
         <artifactId>google-cloud-datastore</artifactId>
-        <version>2.29.2</version><!-- {x-version-update:google-cloud-datastore:current} -->
+        <version>2.29.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-datastore:current} -->
       </dependency>
       <dependency>
         <groupId>com.google.api.grpc</groupId>
         <artifactId>proto-google-cloud-datastore-v1</artifactId>
-        <version>0.120.2</version><!-- {x-version-update:proto-google-cloud-datastore-v1:current} -->
+        <version>0.120.3-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-datastore-v1:current} -->
       </dependency>
       <dependency>
         <groupId>com.google.api.grpc</groupId>
         <artifactId>grpc-google-cloud-datastore-v1</artifactId>
-        <version>2.29.2</version><!-- {x-version-update:grpc-google-cloud-datastore-v1:current} -->
+        <version>2.29.3-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-datastore-v1:current} -->
       </dependency>
       <dependency>
         <groupId>com.google.cloud</groupId>
@@ -189,7 +189,7 @@
       <dependency>
         <groupId>com.google.cloud.datastore</groupId>
         <artifactId>datastore-v1-proto-client</artifactId>
-        <version>2.29.2</version><!-- {x-version-update:datastore-v1-proto-client:current} -->
+        <version>2.29.3-SNAPSHOT</version><!-- {x-version-update:datastore-v1-proto-client:current} -->
         <exclusions>
           <exclusion>
             <groupId>com.google.api.grpc</groupId>
diff --git a/proto-google-cloud-datastore-admin-v1/pom.xml b/proto-google-cloud-datastore-admin-v1/pom.xml
index 4cf802aa..802cde57 100644
--- a/proto-google-cloud-datastore-admin-v1/pom.xml
+++ b/proto-google-cloud-datastore-admin-v1/pom.xml
@@ -4,13 +4,13 @@
   <modelVersion>4.0.0</modelVersion>
   <groupId>com.google.api.grpc</groupId>
   <artifactId>proto-google-cloud-datastore-admin-v1</artifactId>
-  <version>2.29.2</version><!-- {x-version-update:proto-google-cloud-datastore-admin-v1:current} -->
+  <version>2.29.3-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-datastore-admin-v1:current} -->
   <name>proto-google-cloud-datastore-admin-v1</name>
   <description>Proto library for google-cloud-datastore</description>
   <parent>
     <groupId>com.google.cloud</groupId>
     <artifactId>google-cloud-datastore-parent</artifactId>
-    <version>2.29.2</version><!-- {x-version-update:google-cloud-datastore:current} -->
+    <version>2.29.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-datastore:current} -->
   </parent>
   <dependencies>
     <dependency>
diff --git a/proto-google-cloud-datastore-v1/pom.xml b/proto-google-cloud-datastore-v1/pom.xml
index 88f6f688..e5368c00 100644
--- a/proto-google-cloud-datastore-v1/pom.xml
+++ b/proto-google-cloud-datastore-v1/pom.xml
@@ -4,13 +4,13 @@
   <modelVersion>4.0.0</modelVersion>
   <groupId>com.google.api.grpc</groupId>
   <artifactId>proto-google-cloud-datastore-v1</artifactId>
-  <version>0.120.2</version><!-- {x-version-update:proto-google-cloud-datastore-v1:current} -->
+  <version>0.120.3-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-datastore-v1:current} -->
   <name>proto-google-cloud-datastore-v1</name>
   <description>PROTO library for proto-google-cloud-datastore-v1</description>
   <parent>
     <groupId>com.google.cloud</groupId>
     <artifactId>google-cloud-datastore-parent</artifactId>
-    <version>2.29.2</version><!-- {x-version-update:google-cloud-datastore:current} -->
+    <version>2.29.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-datastore:current} -->
   </parent>
   <dependencies>
     <dependency>
diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml
index f771baf7..f96f6fc2 100644
--- a/samples/snapshot/pom.xml
+++ b/samples/snapshot/pom.xml
@@ -28,7 +28,7 @@
     <dependency>
       <groupId>com.google.cloud</groupId>
       <artifactId>google-cloud-datastore</artifactId>
-      <version>2.29.2</version>
+      <version>2.29.3-SNAPSHOT</version>
     </dependency>
     <!-- {x-version-update-end} -->
 
diff --git a/versions.txt b/versions.txt
index d36d84d7..cf2f14cd 100644
--- a/versions.txt
+++ b/versions.txt
@@ -1,10 +1,10 @@
 # Format:
 # module:released-version:current-version
 
-google-cloud-datastore:2.29.2:2.29.2
-google-cloud-datastore-bom:2.29.2:2.29.2
-proto-google-cloud-datastore-v1:0.120.2:0.120.2
-datastore-v1-proto-client:2.29.2:2.29.2
-proto-google-cloud-datastore-admin-v1:2.29.2:2.29.2
-grpc-google-cloud-datastore-admin-v1:2.29.2:2.29.2
-grpc-google-cloud-datastore-v1:2.29.2:2.29.2
+google-cloud-datastore:2.29.2:2.29.3-SNAPSHOT
+google-cloud-datastore-bom:2.29.2:2.29.3-SNAPSHOT
+proto-google-cloud-datastore-v1:0.120.2:0.120.3-SNAPSHOT
+datastore-v1-proto-client:2.29.2:2.29.3-SNAPSHOT
+proto-google-cloud-datastore-admin-v1:2.29.2:2.29.3-SNAPSHOT
+grpc-google-cloud-datastore-admin-v1:2.29.2:2.29.3-SNAPSHOT
+grpc-google-cloud-datastore-v1:2.29.2:2.29.3-SNAPSHOT


Test patch:
diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DatastoreOptionsTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DatastoreOptionsTest.java
index c6a26d05..0c25c3b6 100644
--- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DatastoreOptionsTest.java
+++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/DatastoreOptionsTest.java
@@ -41,6 +41,7 @@ public class DatastoreOptionsTest {
   private static final String PROJECT_ID = "project-id";
   private static final String DATABASE_ID = "database-id";
   private static final int PORT = 8080;
+  private static final int DEFAULT_MAX_CHANNEL_COUNT = 200;
   private DatastoreRpcFactory datastoreRpcFactory;
   private DatastoreRpc datastoreRpc;
   private DatastoreOptions.Builder options;
@@ -119,7 +120,7 @@ public class DatastoreOptionsTest {
             .getChannelPoolSettings();
     assertEquals(channelPoolSettings.getInitialChannelCount(), DatastoreOptions.INIT_CHANNEL_COUNT);
     assertEquals(channelPoolSettings.getMinChannelCount(), DatastoreOptions.MIN_CHANNEL_COUNT);
-    assertEquals(channelPoolSettings.getMaxChannelCount(), DatastoreOptions.MAX_CHANNEL_COUNT);
+    assertEquals(channelPoolSettings.getMaxChannelCount(), DEFAULT_MAX_CHANNEL_COUNT);
   }
 
   @Test
diff --git a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/telemetry/EnabledTraceUtilTest.java b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/telemetry/EnabledTraceUtilTest.java
index 50d7b682..f076c096 100644
--- a/google-cloud-datastore/src/test/java/com/google/cloud/datastore/telemetry/EnabledTraceUtilTest.java
+++ b/google-cloud-datastore/src/test/java/com/google/cloud/datastore/telemetry/EnabledTraceUtilTest.java
@@ -66,12 +66,12 @@ public class EnabledTraceUtilTest {
   @Test
   public void usesGlobalOpenTelemetryIfOpenTelemetryInstanceNotProvided() {
     OpenTelemetrySdk ignored = OpenTelemetrySdk.builder().buildAndRegisterGlobal();
-    DatastoreOptions firestoreOptions =
+    DatastoreOptions datastoreOptions =
         getBaseOptions()
             .setOpenTelemetryOptions(
                 DatastoreOpenTelemetryOptions.newBuilder().setTracingEnabled(true).build())
             .build();
-    EnabledTraceUtil traceUtil = new EnabledTraceUtil(firestoreOptions);
+    EnabledTraceUtil traceUtil = new EnabledTraceUtil(datastoreOptions);
     assertThat(traceUtil.getOpenTelemetry()).isEqualTo(GlobalOpenTelemetry.get());
   }
 
@@ -80,6 +80,34 @@ public class EnabledTraceUtilTest {
     assertThat(newEnabledTraceUtil().getChannelConfigurator()).isNull();
   }
 
+  @Test
+  public void openTelemetryInstanceRegistersGrpcChannelConfigurator() {
+    OpenTelemetrySdk myOpenTelemetrySdk = OpenTelemetrySdk.builder().build();
+    DatastoreOptions firestoreOptions =
+        getBaseOptions()
+            .setOpenTelemetryOptions(
+                DatastoreOpenTelemetryOptions.newBuilder()
+                    .setTracingEnabled(true)
+                    .setOpenTelemetry(myOpenTelemetrySdk)
+                    .build())
+            .build();
+    EnabledTraceUtil traceUtil = new EnabledTraceUtil(firestoreOptions);
+    assertThat(traceUtil.getChannelConfigurator()).isNotNull();
+  }
+
+  @Test
+  public void globalOpenTelemetryRegistersGrpcChannelConfigurator() {
+
+    OpenTelemetrySdk.builder().buildAndRegisterGlobal();
+    DatastoreOptions datastoreOptions =
+        getBaseOptions()
+            .setOpenTelemetryOptions(
+                DatastoreOpenTelemetryOptions.newBuilder().setTracingEnabled(true).build())
+            .build();
+    EnabledTraceUtil traceUtil = new EnabledTraceUtil(datastoreOptions);
+    assertThat(traceUtil.getChannelConfigurator()).isNotNull();
+  }
+
   @Test
   public void usesEnabledContext() {
     assertThat(newEnabledTraceUtil().getCurrentContext() instanceof EnabledTraceUtil.Context)