diff --git a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOpenTelemetry.java b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOpenTelemetry.java index cee8fcb5b654..956c2cc02298 100644 --- a/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOpenTelemetry.java +++ b/java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOpenTelemetry.java @@ -206,9 +206,7 @@ public static Logging createLoggingClient( } public static void releaseSdk(OpenTelemetry openTelemetry) { - if (openTelemetry == null - || openTelemetry == GlobalOpenTelemetry.get() - || openTelemetry == OpenTelemetry.noop()) { + if (openTelemetry == null || openTelemetry == OpenTelemetry.noop()) { return; } diff --git a/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITOpenTelemetryTest.java b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITOpenTelemetryTest.java index 9baf187b4d38..1c0e63458f95 100644 --- a/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITOpenTelemetryTest.java +++ b/java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITOpenTelemetryTest.java @@ -258,12 +258,7 @@ private String verifyAndFetchLogs(String connectionUuid) throws Exception { .setCredentials(credentials) .build() .getService()) { - String filter = - "logName:\"projects/" - + PROJECT_ID - + "/logs/com.google.cloud.bigquery\" AND labels.\"jdbc.connection_id\"=\"" - + connectionUuid - + "\""; + String filter = "labels.\"jdbc.connection_id\"=\"" + connectionUuid + "\""; List entries = fetchLogsWithRetry(logging, filter); assertFalse(entries.isEmpty(), "Telemetry logs should be exported to GCP"); @@ -306,8 +301,11 @@ private Trace verifyAndFetchTrace(String traceId) throws Exception { private T pollWithRetry(java.util.concurrent.Callable task) throws InterruptedException { int attempts = 0; - int maxAttempts = 20; // 20 attempts * 3000ms = 60 seconds max delay - long delayMs = 3000; // 3000ms linear polling + int maxAttempts = 10; + long delayMs = 10000; + + // 10 second wait for GCP to ingest data + Thread.sleep(10000); while (attempts < maxAttempts) { attempts++;