From e9e257f3d46983d9d8255a361293e1158465161e Mon Sep 17 00:00:00 2001 From: Yiru Tang Date: Tue, 12 Mar 2024 23:00:47 +0000 Subject: [PATCH] . --- .../cloud/bigquery/storage/v1/StreamWriter.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/StreamWriter.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/StreamWriter.java index 23a5486829..4b2387b93e 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/StreamWriter.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/StreamWriter.java @@ -825,11 +825,14 @@ public StreamWriter build() throws IOException { } String getFullTraceId() { - String version = GaxProperties.getLibraryVersion(StreamWriter.class); - if (traceId == null) { - return clientId + ":" + version; + String clientWithVersion = + GaxProperties.getLibraryVersion(StreamWriter.class).isEmpty() + ? clientId + : clientId + ":" + GaxProperties.getLibraryVersion(StreamWriter.class); + if (traceId == null || traceId.isEmpty()) { + return clientWithVersion; } else { - return clientId + ":" + version + " " + traceId; + return clientWithVersion + " " + traceId; } } }