Skip to content

Commit d6239cd

Browse files
authored
---
yaml --- r: 7483 b: refs/heads/tswast-patch-1 c: 30a7995 h: refs/heads/master i: 7481: e4c5eb7 7479: b234b11
1 parent ce2fc60 commit d6239cd

2 files changed

Lines changed: 14 additions & 7 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@ refs/tags/v0.18.0: 9d193c4c4b9d1c6f21515dd8e50836b9194ec9bb
5757
refs/tags/v0.19.0: e67b56e4d8dad5f9a7b38c9b2107c23c828f2ed5
5858
refs/tags/v0.20.0: 839f7fb7156535146aa1cb2c5aadd8d375d854e8
5959
refs/tags/v0.20.1: 370471f437f1f4f68a11e068df5cd6bf39edb1fa
60-
refs/heads/tswast-patch-1: e8706fbdb1f2dd655670a2162884402c31ee5850
60+
refs/heads/tswast-patch-1: 30a79956c35ce953ee2ea4b9d3f0372864f593f7
6161
refs/heads/pubsub-streaming-pull: 19262b752ee874eb2ca3b950eb2aef44d5a5267b

branches/tswast-patch-1/gcloud-java-logging/src/main/java/com/google/cloud/logging/spi/DefaultLoggingRpc.java

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package com.google.cloud.logging.spi;
1818

19+
import static com.google.common.base.MoreObjects.firstNonNull;
20+
1921
import com.google.api.gax.core.RetrySettings;
2022
import com.google.api.gax.grpc.ApiCallSettings;
2123
import com.google.api.gax.grpc.ApiException;
@@ -97,13 +99,18 @@ protected ExecutorFactory<ScheduledExecutorService> executorFactory() {
9799
public DefaultLoggingRpc(LoggingOptions options) throws IOException {
98100
executorFactory = new InternalLoggingOptions(options).executorFactory();
99101
executor = executorFactory.get();
102+
String libraryName = options.libraryName();
103+
String libraryVersion = firstNonNull(options.libraryVersion(), "");
100104
try {
101-
ConfigServiceV2Settings.Builder confBuilder =
102-
ConfigServiceV2Settings.defaultBuilder().provideExecutorWith(executor, false);
103-
LoggingServiceV2Settings.Builder logBuilder =
104-
LoggingServiceV2Settings.defaultBuilder().provideExecutorWith(executor, false);
105-
MetricsServiceV2Settings.Builder metricsBuilder =
106-
MetricsServiceV2Settings.defaultBuilder().provideExecutorWith(executor, false);
105+
ConfigServiceV2Settings.Builder confBuilder = ConfigServiceV2Settings.defaultBuilder()
106+
.provideExecutorWith(executor, false)
107+
.setClientLibHeader(libraryName, libraryVersion);
108+
LoggingServiceV2Settings.Builder logBuilder = LoggingServiceV2Settings.defaultBuilder()
109+
.provideExecutorWith(executor, false)
110+
.setClientLibHeader(libraryName, libraryVersion);
111+
MetricsServiceV2Settings.Builder metricsBuilder = MetricsServiceV2Settings.defaultBuilder()
112+
.provideExecutorWith(executor, false)
113+
.setClientLibHeader(libraryName, libraryVersion);
107114
// todo(mziccard): PublisherSettings should support null/absent credentials for testing
108115
if (options.host().contains("localhost")
109116
|| options.authCredentials().equals(AuthCredentials.noAuth())) {

0 commit comments

Comments
 (0)