Skip to content

Commit 855ab94

Browse files
committed
fix: customOpenTelemetry injection in properties
1 parent f1c14f0 commit 855ab94

File tree

1 file changed

+6
-0
lines changed
  • java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc

1 file changed

+6
-0
lines changed

java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDriver.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.google.cloud.bigquery.exception.BigQueryJdbcRuntimeException;
2121
import io.grpc.LoadBalancerRegistry;
2222
import io.grpc.internal.PickFirstLoadBalancerProvider;
23+
import io.opentelemetry.api.OpenTelemetry;
2324
import java.io.IOException;
2425
import java.sql.Connection;
2526
import java.sql.Driver;
@@ -122,6 +123,8 @@ public Connection connect(String url, Properties info) throws SQLException {
122123
try {
123124
if (acceptsURL(url)) {
124125
Properties connectInfo = info == null ? new Properties() : (Properties) info.clone();
126+
Object customOpenTelemetryObj = connectInfo.remove("customOpenTelemetry");
127+
125128
String connectionUri =
126129
BigQueryJdbcUrlUtility.appendPropertiesToURL(
127130
url.substring(5), this.toString(), connectInfo);
@@ -132,6 +135,9 @@ public Connection connect(String url, Properties info) throws SQLException {
132135
}
133136

134137
DataSource ds = DataSource.fromUrl(connectionUri);
138+
if (customOpenTelemetryObj instanceof OpenTelemetry) {
139+
ds.setCustomOpenTelemetry((OpenTelemetry) customOpenTelemetryObj);
140+
}
135141

136142
// LogLevel
137143
String logLevelStr = ds.getLogLevel();

0 commit comments

Comments
 (0)