GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add informational headers to gRPC requests sent for datastore · Issue #2230 · googleapis/google-cloud-python

Add informational headers to gRPC requests sent for datastore #2230

New issue
Copy link
New issue
Copy link
Closed
Closed
Add informational headers to gRPC requests sent for datastore#2230
Copy link
Assignees
lukesneeringer
Labels
api: datastoreIssues related to the Datastore API.grpcpriority: p2Moderately-important priority. Fix may not be included in next release.

Description

@dhermes
dhermes
opened on Aug 31, 2016
Issue body actions

See googleapis/google-cloud-node#1542

We need to modify the headers being sent to:

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

Though we may want to do this on a per-request basis. Probably not, since self._user_agent doesn't change after the MetadataPlugin object is created, even if the user agent on the original Client has changed.

Activity

  1. dhermes
    added
    api: datastoreIssues related to the Datastore API.
    grpc
    on Aug 31, 2016
  2. tseaver commented on Sep 6, 2016

    @tseaver
    tseaver
    on Sep 6, 2016
    Contributor
    More actions

    #2221 is broader than this issue would suggest.

  3. dhermes commented on Sep 9, 2016

    @dhermes
    dhermes
    on Sep 9, 2016
    ContributorAuthor
    More actions

    @tseaver Focusing on the datastore case, this is a bit awkward even as-is. The Connection doesn't have access to the project, since the Client handles that.

    But the Connection is essentially a dumb wrapper around _DatastoreAPIOverHttp / _DatastoreAPIOverGRPC combined with some helpers for constructing the protobufs to be sent off.

    WDYT about removing the datastore.connection module all together?

  4. tseaver commented on Sep 9, 2016

    @tseaver
    tseaver
    on Sep 9, 2016
    Contributor
    More actions

    The Connection class is still responsible for managing the low-leve REST bits: I guess you could gut those parts into the _DatastoreAPIOverHttp class, and have the client just hold an instance of it (or the gRPC variant). They still need somewhere to live, which makes trashing the module problematic.

  5. dhermes commented on Sep 9, 2016

    @dhermes
    dhermes
    on Sep 9, 2016
    ContributorAuthor
    More actions

    is still responsible for managing the low-leve REST bits

    Not really

  6. tseaver commented on Sep 9, 2016

    @tseaver
    tseaver
    on Sep 9, 2016
    Contributor
    More actions

    That example delgates to the connection's _build_api_url method, uses its USER_AGENT, an calls into its http attr to make the actual request. Those were the bits I was talking about moving into _DatastoreAPIOverHttp.

  7. dhermes commented on Sep 9, 2016

    @dhermes
    dhermes
    on Sep 9, 2016
    ContributorAuthor
    More actions

    Gotcha! That was just "laziness" to get the implementation to fit. I've got a speculative PR in the works, coming soon. We can chat about that?

  8. lukesneeringer
    added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    on Apr 19, 2017
  9. lukesneeringer commented on Aug 11, 2017

    @lukesneeringer
    lukesneeringer
    on Aug 11, 2017
    Contributor
    More actions

    Hello,
    One of the challenges of maintaining a large open source project is that sometimes, you can bite off more than you can chew. As the lead maintainer of google-cloud-python, I can definitely say that I have let the issues here pile up.

    As part of trying to get things under control (as well as to empower us to provide better customer service in the future), I am declaring a "bankruptcy" of sorts on many of the old issues, especially those likely to have been addressed or made obsolete by more recent updates.

    My goal is to close stale issues whose relevance or solution is no longer immediately evident, and which appear to be of lower importance. I believe in good faith that this is one of those issues, but I am scanning quickly and may occasionally be wrong. If this is an issue of high importance, please comment here and we will reconsider. If this is an issue whose solution is trivial, please consider providing a pull request.

    Thank you!

  10. lukesneeringer
    closed this as completedon Aug 11, 2017
  11. eddavisson commented on Dec 21, 2017

    @eddavisson
    eddavisson
    on Dec 21, 2017
    More actions

    @lukesneeringer, could we re-open this?

    We are still interested in having this header added to gRPC requests:

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

    (This functionality is already in place for Spanner and Firestore.)

    This is may not be relevant for all APIs, so I think this is the right issue to re-open as opposed to #2221.

    Thanks!

  12. JustinBeckwith
    assigned
    lukesneeringer
    on Feb 1, 2021
  13. parthea
    added 2 commits that reference this issue on Apr 1, 2026

    fix: do not warn with DefaultIndexWarning in partial ordering mode (#…

    5a59f59

    chore: release 2.30.0 (#2308)

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

Metadata

Metadata

Assignees

  • @lukesneeringer
    lukesneeringer

Labels

api: datastoreIssues related to the Datastore API.grpcpriority: p2Moderately-important priority. Fix may not be included in next release.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.