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

Determine the project used to export GCS+gRPC metrics #14112

Closed
9 tasks done
Tracked by #13998
coryan opened this issue May 1, 2024 · 0 comments · Fixed by #14245
Closed
9 tasks done
Tracked by #13998

Determine the project used to export GCS+gRPC metrics #14112

coryan opened this issue May 1, 2024 · 0 comments · Fixed by #14245
Assignees
Labels
api: storage Issues related to the Cloud Storage API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@coryan
Copy link
Member

coryan commented May 1, 2024

  • If the resource detector detects a GCP project, use that.
  • If the storage::ProjectIdOption is set and not empty, use that.
  • If the GAE_PROJECT environment variable is set, use that. ignore this, C++ does not work in GAE
  • If ADC points to a file, use the project_id field from that file (if applicable).
    - https://google.aip.dev/auth/4112 for service account key files
    - The field may exist in user credentials, and does not exist for external accounts
  • The Google Cloud SDK project ID ignore for now. This is really difficult in C++, and only useful with user credentials, which are not expected to need metrics that often.
  • If we are using GCE credentials, use the value of computeMetadata/v1/project/project-id from the VM metadata
    curl -sv -HMetadata-Flavor:Google http://metadata.google.internal./computeMetadata/v1/project/project-id
    
  • Parse the project id from the ADC file.
  • Fetch the project id from the GCE credentials.
  • Add project id accessors to the oauth2 credentials files.

We may be able to use the resource detector. OTOH, we need to add this functionality to the REST credentials. This will all require converting GUACs to REST credentials, performing one query and then discarding the infrastructure created to make the query.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant