Skip to content
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

Emit header for gRPC messages #1542

Closed
pcostell opened this issue Aug 30, 2016 · 2 comments
Closed

Emit header for gRPC messages #1542

pcostell opened this issue Aug 30, 2016 · 2 comments
Assignees
Labels
api: datastore Issues related to the Datastore API.

Comments

@pcostell
Copy link
Contributor

pcostell commented Aug 30, 2016

gRPC connections currently don't have enough information in the request for us to do efficient traffic management/routing.

Will you add a header that allows for us to optimize for this on the server? The header format is:

name: google-cloud-resource-prefix
value: projects/my-project-id

In general, the prefix would be the same as the JSON-over-http URL up to any custom method. For example, a Cloud Datastore commit message over JSON would hit the url projects/my-project-id:commit.

Here is an example usage in the cloud-bigtable-client: https://github.com/GoogleCloudPlatform/cloud-bigtable-client/pull/915/files#diff-1078787e69bc1d7c5bb8507f0a87a143R83

@dhermes
Copy link
Contributor

dhermes commented Aug 31, 2016

@pcostell This should be true in Python as well?

headers = [
    ('authorization', 'Bearer ' + access_token),
    ('user-agent', self._user_agent),
    ('google-cloud-resource-prefix', 'projects/my-project-id'),
]

@pcostell
Copy link
Contributor Author

Yes -- note that we don't need it for proto/JSON-over-HTTP, only for gRPC calls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the Datastore API.
Projects
None yet
Development

No branches or pull requests

4 participants