Skip to content

Add more useful header info on HTTP requests #3006

Closed

Activity

  1. tseaver commented on Feb 13, 2017

    @tseaver
    Contributor

    Seems like we could override the USER_AGENT class attribute for the APIs which use JSONConnection, and derive it from pkg_resources (maybe add a helper for that?). E.g.:

    from pkg_resources import get_distribution
    
    from google.cloud._http import JSONConnection
    
    
    class Connection(JSONConnection):
        USER_AGENT = 'google-cloud-foo-python/{0}'.format(
            get_distribution('google-cloud-foo').version)

    I don't know whether the -python suffix should be there. @lukesneeringer can you confirm?

  2. lukesneeringer commented on Feb 13, 2017

    @lukesneeringer
    Contributor

    It is actually moving to a new header, X-Goog-API-Client, and the client library is going to be abbreviated gccl (google cloud client library).

    We also intend to track the language via gl-python/{v}, which should appear at the beginning of the string. GAX already does this, but the HTTP base client will need to add it, too.

    We probably still need to set a User-Agent string (just because it is considered good practice), and it does not matter what it is. google-cloud-core/{v} seems appropriate for that but I will defer to whatever you folks want (provided it is sane).

  3. dhermes commented on Feb 13, 2017

    @dhermes
    ContributorAuthor

    @lukesneeringer The value of gcloud-python used to be deemed "sacred" to preserve some reporting internal to Google. That may no longer be true.

  4. lukesneeringer commented on Feb 13, 2017

    @lukesneeringer
    Contributor

    This is no longer true. The new header is superceding the old one.

  5. dhermes commented on Feb 17, 2017

    @dhermes
    ContributorAuthor

    #3035 is most of the "intellectual conceptual way" towards this

  6. dhermes commented on Feb 21, 2017

    @dhermes
    ContributorAuthor

    Remaining APIs:

    • bigquery
    • datastore
    • dns
    • error_reporting
    • language
    • logging
    • monitoring
    • pubsub
    • resource_manager
    • runtimeconfig
    • speech
    • storage
    • translate
    • vision
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions