Skip to content

fix: add user agent to session path - #14835

Merged
mutianf merged 5 commits into
googleapis:mainfrom
mutianf:user-agent
Oct 30, 2026
Merged

mutianf merged 5 commits into
googleapis:mainfrom
mutianf:user-agent

Conversation

@mutianf

@mutianf mutianf commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@mutianf
mutianf requested review from a team as code owners October 29, 2026 16:25

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a custom UserAgentInterceptor to append a custom user-agent header to gRPC channels across different channel providers. The reviewer feedback suggests a cleaner and more efficient approach: instead of implementing a custom interceptor and forwarding client calls (which introduces unnecessary allocation overhead), the standard ManagedChannelBuilder.userAgent(String) method should be used to configure the user agent. Consequently, the custom interceptor, its associated metadata key, and the unused gRPC imports can be safely removed.

@mutianf

mutianf commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates ChannelProviders.java to append a custom user agent string (bigtable-java/) to the ManagedChannelBuilder instances created in various channel providers. There are no review comments to address, and we have no further feedback to provide.

Comment on lines +42 to +46
BigtableStubSettings.defaultApiClientHeaderProviderBuilder()
.build()
.getHeaders()
.get("x-goog-api-client");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should hardcode it. This kind of makes the interaction between gapic and jetstream worse. We should be aiming to keep jetstream a lower layer than gapic. We had to break that rule for the overly complex logic in InstantiatingGrpcChannelProvider. But here I think reward for breaking that rule is not justified. So I would jsut hard code

@mutianf
mutianf enabled auto-merge (squash) October 30, 2026 14:58
@mutianf
mutianf merged commit a653638 into googleapis:main Oct 30, 2026
207 checks passed
@mutianf
mutianf deleted the user-agent branch October 30, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants