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 — Where do we set the user agent in the request? · Issue #278 · googleapis/google-cloud-java

Where do we set the user agent in the request? #278

New issue
Copy link
New issue
Copy link
Closed
Closed
Where do we set the user agent in the request?#278
Copy link
Assignees
aozarov
Labels
api: coretype: questionRequest for information or clarification. Not an issue.

Description

@jgeewax
jgeewax
opened on Oct 21, 2015
Issue body actions

Do we set it as gcloud-java/[version] ?

Activity

Next
  1. jgeewax
    added
    type: questionRequest for information or clarification. Not an issue.
    on Oct 21, 2015
  2. aozarov commented on Oct 22, 2015

    @aozarov
    aozarov
    on Oct 22, 2015
    Contributor
    More actions

    It is now hard-coded as "gcloud-java".

    Adding the version would be nice and as we already include it in the jar's manifest that would not be hard. We should probably have this logic for getting the "application name" in the core module
    as a utility or as part of the ServiceOptions.

    Note, setting it for the datastore would be a little tricky as we don't use the apiary client directly but rather use the datastore-protobuf client which does not seem to expose it. /cc @pcostell

  3. aozarov
    added
    api: core
    on Oct 22, 2015
  4. circy9 commented on Oct 22, 2015

    @circy9
    circy9
    on Oct 22, 2015
    More actions

    Is it possible to set a header in datastore calls?
    A separate question, do you have access to the headers of the incoming HTTP requests?

    For example, a user makes a HTTP request, say ListMyContacts, to the app and then the app makes a bunch of datastore call to handle the HTTP request. I am interested in extracting headers from this user issued HTTP request.

  5. aozarov commented on Oct 22, 2015

    @aozarov
    aozarov
    on Oct 22, 2015
    Contributor
    More actions

    I think we will be able to set it also in the Datastore calls, but I cc @pcostell for some advice (so we will do it the right way).

    The app which uses gcloud-java could be a stand-alone, servlet, or anything else. The app does not pass any context information to the gcloud-java api and therefore we are not aware if a call is triggered by some HTTP request or have any information about it.

  6. aozarov
    assigned
    ajkannan
    on Oct 22, 2015
  7. aozarov commented on Oct 23, 2015

    @aozarov
    aozarov
    on Oct 23, 2015
    Contributor
    More actions

    @mziccard Do you want to take care of this? Ajay has already few outstanding issues to take care of.

  8. aozarov
    assigned
    mziccard
    and unassigned
    ajkannan
    on Oct 23, 2015
  9. pcostell commented on Oct 26, 2015

    @pcostell
    pcostell
    on Oct 26, 2015
    Contributor
    More actions

    It looks like you could do this either by continuing to use the Datastore clients and override RemoteRpc.java (which then gets passed in when you create a Datastore), or you could just stop using the client (may be better long term since you replicate a lot of the work anyways for the other APIs).

  10. aozarov commented on Oct 26, 2015

    @aozarov
    aozarov
    on Oct 26, 2015
    Contributor
    More actions

    I don't think we can override RemoteRpc.java as it is package protected.

    Right, we could avoid using the Datastore protobuf client and instead use the apiary client directly but I wonder if it is worth the effort considering the future migration to gRPC. Also, do you have this client available for v1beta3?

    /cc @ajkannan

  11. pcostell commented on Oct 26, 2015

    @pcostell
    pcostell
    on Oct 26, 2015
    Contributor
    More actions

    Ah good point -- we could probably add some extra handling to push headers onto the call.

    If you are planning a grpc migration soon you could do that too -- v1beta3 does work with grpc.

    We have a v1beta3 implementation but it hasn't made it onto github yet. If you ping me privately I can send you a link.

  12. ajkannan commented on Oct 26, 2015

    @ajkannan
    ajkannan
    on Oct 26, 2015
    More actions

    Looking at what we use within the Datastore client, I think we could decouple gcloud-java from the Datastore client without too much effort now and then maintain it without too much additional work. It looks like we would only need to replace the functionality of the client's RemoteRpc.java, DatastoreFactory.java, Datastore.java, and DatastoreOptions.java. Most of the work in the client's DatastoreHelper.java is done by our gcloud-java-core module.

  13. ajkannan commented on Oct 27, 2015

    @ajkannan
    ajkannan
    on Oct 27, 2015
    More actions

    I spent some time trying to use the apiary client, and that necessitated a lot of superficial changes that would be more trouble than its worth, especially when merging in the v1beta3 branch. I can look into using gRPC after the v1beta3 branch is merged in and we're ready to migrate to gRPC.

  14. aozarov commented on Oct 29, 2015

    @aozarov
    aozarov
    on Oct 29, 2015
    Contributor
    More actions

    I think we should consider #307 as a fix for this issue. I opened a separate issue, #308, for just Datastore.

  15. 14 remaining items

  16. github-actions
    added 5 commits that reference this issue on Oct 4, 2022

    chore(main): release 1.1.5 (#285)

    8167dcd

    chore(main): release 1.2.5 (#289)

    14ff163

    chore(main): release 1.0.5 (#300)

    0f59512

    chore(main): release 1.2.8 (#298)

    ac58e93

    chore(deps): update dependency com.google.cloud:google-cloud-gsuite-a…

    b47d815
  17. suztomo
    added a commit that references this issue on Feb 1, 2023

    chore(main): release 2.0.0 (#739)

    ea9f421
  18. chingor13
    added 2 commits that reference this issue on Jan 6, 2026

    deps: update dependency com.google.cloud:google-cloud-logging to v2.1…

    9b3b7dd

    chore: release 0.119.3 (#280)

    eb5b9e4
  19. chingor13
    added a commit that references this issue on Jan 22, 2026

    chore: release 1.105.3 (#278)

    7a5ebf6
  20. chingor13
    added a commit that references this issue on Feb 24, 2026

    Update instructions for google-auth-library-appengine artifact (#278)

    19a9ba5
  21. chingor13
    added a commit that references this issue on Mar 12, 2026

    Update instructions for google-auth-library-appengine artifact (#278)

    f5ce5ed
  22. suztomo
    added a commit that references this issue on Mar 23, 2026

    deps: do not re-declare grpc dependencies as test dependencies (googl…

    6f8c0bc
  23. suztomo
    added a commit that references this issue on Mar 30, 2026

    chore: add product documentation link (#278)

    eb2c7c1
  24. lqiu96
    added a commit that references this issue on Apr 1, 2026

    chore: add product documentation link (#278)

    7fdf989
  25. benjaminp
    added a commit that references this issue on Jul 13, 2026

    deps: update autovalue.version to v1.7.1 (googleapis#278)

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

Metadata

Metadata

Assignees

  • @aozarov
    aozarov

Labels

api: coretype: questionRequest for information or clarification. Not an issue.

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.