feat: Track PG Adapter usage from user-agent headers#1711
feat: Track PG Adapter usage from user-agent headers#1711olavloite merged 6 commits intogoogleapis:mainfrom
Conversation
…oken, so that when PG Adapter connects via client library by passing the string "pg-adapter" in the user-agent header, it doesn't get discarded.
| .setCredentials(NoCredentials.getInstance()) | ||
| .setClientLibToken(pgAdapterToken) | ||
| .build(); | ||
| assertThat(options.getClientLibToken()).isEqualTo(pgAdapterToken); |
There was a problem hiding this comment.
nit: we prefer the use of assertEquals(expected, actual) (add import static org.junit.Assert.assertEquals at the top of the file to import it)
I know that it is not consistent with the other tests here, but the general rule of thumb is to use this method for new code, even when it is different from the surrounding code.
There was a problem hiding this comment.
Thanks @olavloite for mentioning this. I've changed it and will remember this in future
|
@ansh0l Do you know why the OwlBot check seems to be hanging? Is that because the PR has been created from a fork instead of a branch directly in the repository? And if so, is that something you can override for this PR? |
|
@olavloite it does not run by default from forks, we just need to add the label |
Added the string "pg-adapter" in the list of allowed client library token, so that when PG Adapter connects via client library by passing the string "pg-adapter" in the user-agent header, it doesn't get discarded. Also, added the one test case to cover the same.
Fixes b/213946108