Skip to content

Commit 43fd699

Browse files
authored
fix: add version id to the client lib header (#2447)
* fix:add version id to the client lib header * .
1 parent d629194 commit 43fd699

File tree

1 file changed

+8
-3
lines changed
  • google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1

1 file changed

+8
-3
lines changed

google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/StreamWriter.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.google.api.gax.batching.FlowController;
2020
import com.google.api.gax.core.CredentialsProvider;
2121
import com.google.api.gax.core.ExecutorProvider;
22+
import com.google.api.gax.core.GaxProperties;
2223
import com.google.api.gax.retrying.RetrySettings;
2324
import com.google.api.gax.rpc.TransportChannelProvider;
2425
import com.google.auth.Credentials;
@@ -824,10 +825,14 @@ public StreamWriter build() throws IOException {
824825
}
825826

826827
String getFullTraceId() {
827-
if (traceId == null) {
828-
return clientId;
828+
String clientWithVersion =
829+
GaxProperties.getLibraryVersion(StreamWriter.class).isEmpty()
830+
? clientId
831+
: clientId + ":" + GaxProperties.getLibraryVersion(StreamWriter.class);
832+
if (traceId == null || traceId.isEmpty()) {
833+
return clientWithVersion;
829834
} else {
830-
return clientId + " " + traceId;
835+
return clientWithVersion + " " + traceId;
831836
}
832837
}
833838
}

0 commit comments

Comments
 (0)