-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: User agent header addition #46
Conversation
@gauravsnj To format the file according to the wishes of the lint check you must run the command |
… user-agent-header-addition
String userAgent = | ||
metadata.get( | ||
Metadata.Key.of( | ||
"x-goog-api-client", Metadata.ASCII_STRING_MARSHALLER)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The client library token header that includes the value is named x-goog-api-client
.
Metadata.Key.of( | ||
"x-goog-api-client", Metadata.ASCII_STRING_MARSHALLER)); | ||
assertNotNull(userAgent); | ||
assertTrue(userAgent.contains("pg-adapter")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The header value also includes information about the gax version used etc. So we should only verify that the pg-adapter
value is included, not that it only contains pg-adapter
.
Currently, client libraries send headers which is used for tracking adoption, version etc
We should extend that header (user-agent) to track PGAdapter binary and version.
fixes http://b/213946108