Skip to content

Conversation

@dhermes
Copy link
Contributor

@dhermes dhermes commented Sep 9, 2016

Fixes #2271.

See https://github.com/GoogleCloudPlatform/gcloud-common/issues/179 for context.

Also moving gRPC user-agent from plugin to channel options. For context on that change, see the comment by @murgatroid99: https://github.com/GoogleCloudPlatform/google-cloud-node/pull/1568/files#r77727186

As for grpc.primary_user_agent vs grpc.secondary_user_agent, @nathanielmanistaatgoogle said

That way the user agent as it appears on the wire should be "primarily gRPC, secondarily gcloud" rather than "primarily gcloud ".

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Sep 9, 2016
@tseaver
Copy link
Contributor

tseaver commented Sep 9, 2016

LGTM. The primary / secondary bit doesn't really make sense, but if it is what the back-end team wants, I can acquiesce.

@dhermes dhermes added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Sep 9, 2016
@dhermes
Copy link
Contributor Author

dhermes commented Sep 9, 2016

Added the "don't merge" label. I'll hold off on merging until @nathanielmanistaatgoogle and/or @murgatroid99 can weigh in.

@nathanielmanistaatgoogle

Luhguhtum, but I'd also appreciate hearing from @murgatroid99.

@murgatroid99
Copy link

I don't actually know what the primary vs secondary user agents are supposed to be, semantically. Node appends its own user agent string to the provided primary user agent string, so I just assumed that the calling library was expected to provide its own primary user agent string.

@dhermes dhermes removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Sep 9, 2016
@dhermes
Copy link
Contributor Author

dhermes commented Sep 9, 2016

I'm going to merge then since the consensus from the two gRPC maintainers is like 75% of a thumbs up: "do it" and "not sure"

I'd say this should probably be documented somewhere though?

@dhermes dhermes merged commit 891b060 into googleapis:master Sep 9, 2016
@dhermes dhermes deleted the user-agent-options branch September 9, 2016 15:20
@nathanielmanistaatgoogle

@dhermes: Aww, phooey, I just had a conversation on your behalf with @ctiller.

A few takeaways:

  • If an application attempts to set user-agent as though it were an ordinary piece of metadata, the core will eat the supplied value and not put it on the wire, so using (a) channel argument(s) is the only way to alter the user-agent sent to the server along with your RPCs. So the whole conversation we had the other day about which means was preferred apparently could have been resolved by the knowledge that only one means is effective.
  • Culturally, the "most important" or "most specific" information in the user-agent string goes first, so I erred in guiding you to pass your application information as a secondary, rather than primary, user agent channel arg. My apologies; today I learned.

I've filed grpc.github.io issue 380 to track improving our documentation for user-agent application best practices.

dhermes added a commit to dhermes/google-cloud-python that referenced this pull request Sep 9, 2016
@dhermes
Copy link
Contributor Author

dhermes commented Sep 9, 2016

It's an easy fix, I'll send the PR to fix post-haste. Thanks for looking into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: core cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants