Skip to content

Commit 14353a6

Browse files
authored
---
yaml --- r: 5009 b: refs/heads/master c: 30a7995 h: refs/heads/master i: 5007: 6f3d9f9
1 parent e260f97 commit 14353a6

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
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: e8706fbdb1f2dd655670a2162884402c31ee5850
2+
refs/heads/master: 30a79956c35ce953ee2ea4b9d3f0372864f593f7
33
refs/heads/travis: e21ee7b88a5edc3f3d8c71f90c3fc32abf7e8dd6
44
refs/heads/gh-pages: 7406918e071dd2c5677a638ae2a06e7592b6542c
55
refs/heads/pubsub-alpha: d6bbd32eed6cb48cda8d6798ee70ddd6bfc1f07d

trunk/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)