feat: include User agent#747
Merged
thiagotnunes merged 4 commits intogoogleapis:masterfrom Dec 15, 2020
Merged
Conversation
Comment on lines
384
to
388
| options.getSpannerStubSettings().toBuilder() | ||
| .setTransportChannelProvider(channelProvider) |
There was a problem hiding this comment.
Suggested change
| options.getSpannerStubSettings().toBuilder() | |
| .setTransportChannelProvider(channelProvider) | |
| options | |
| .getSpannerStubSettings() | |
| .toBuilder() | |
| options | |
| .getSpannerStubSettings() | |
| .executeSqlSettings() | |
| .getRetrySettings() | |
| .toBuilder() |
Comment on lines
423
to
433
| options.getInstanceAdminStubSettings().toBuilder() | ||
| .setTransportChannelProvider(channelProvider) |
There was a problem hiding this comment.
Suggested change
| options.getInstanceAdminStubSettings().toBuilder() | |
| .setTransportChannelProvider(channelProvider) | |
| options | |
| .getInstanceAdminStubSettings() | |
| .toBuilder() | |
| options | |
| .getDatabaseAdminStubSettings() | |
| .toBuilder() |
| options | ||
| .getInstanceAdminStubSettings() | ||
| .toBuilder() | ||
| options.getInstanceAdminStubSettings().toBuilder() |
There was a problem hiding this comment.
Suggested change
| options.getInstanceAdminStubSettings().toBuilder() | |
| options | |
| .getInstanceAdminStubSettings() | |
| .toBuilder() |
Codecov Report
@@ Coverage Diff @@
## master #747 +/- ##
=========================================
Coverage 85.05% 85.06%
Complexity 2556 2556
=========================================
Files 142 142
Lines 13930 13938 +8
Branches 1326 1326
=========================================
+ Hits 11848 11856 +8
Misses 1526 1526
Partials 556 556
Continue to review full report at Codecov.
|
a6d4e7c to
6a41e9a
Compare
thiagotnunes
suggested changes
Dec 15, 2020
| .setHeaderProvider(mergedHeaderProvider) | ||
|
|
||
| // Inject client library version to `user-agent` | ||
| .setHeaderProvider( |
Contributor
There was a problem hiding this comment.
We are overriding the header provider here, instead of adding to it. We have to manually construct a new provider that will encapsulate the existing one the the new one:
private static final String USER_AGENT_KEY = "user-agent";
private static final String CLIENT_LIBRARY_LANGUAGE = "spanner-java";
Map<String, String> headersWithUserAgent = ImmutableMap.<String, String>builder()
.put(USER_AGENT_KEY, CLIENT_LIBRARY_LANGUAGE + "/" + GaxProperties.getLibraryVersion(GapicSpannerRpc.class)))
.putAll(mergedHeaderProvider.getHeaders())
.build();
final HeaderProvider headerProviderWithUserAgent = FixedHeaderProvider.create(headersWithUserAgent);
...
.setHeaderProvider(headerProviderWithUserAgent);6a41e9a to
a075cff
Compare
thiagotnunes
approved these changes
Dec 15, 2020
4 tasks
thiagotnunes
pushed a commit
that referenced
this pull request
May 6, 2021
* chore: add DirectPath fallback integration test * feat: include User agent
rajatbhatta
pushed a commit
to rajatbhatta/java-spanner
that referenced
this pull request
Nov 17, 2022
🤖 I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Configure the UserAgent in addition to x-goog-api-client. This will be needed for DirectPath.