prometheus-community / prometheus-community/stackdriver_exporter
Does not respect GOOGLE_CLOUD_QUOTA_PROJECT env variable
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 295
- Forks
- 117
- Avg merge
- 9d 14h
- Merged PRs (30d)
- 7
Description
The monitoring.Service is constructed with a http.Client based on google.DefaultClient from golang.org/x/oauth2/google.
It seems this does not respect the environment variable GOOGLE_CLOUD_QUOTA_PROJECT to set the X-goog-user-project request header (GCP docs). The use of WithHTTPClient takes precedence and so the code that would otherwise set up the client in a way that respected the quota project is not used.
I can't see a straightforward way to fix this without specifically adding something into stackdriver_exporter to configure the quota project – but I'm not an expert in Go or the GCP client libraries.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the monitoring.Service construction and trace how google.DefaultClient and WithHTTPClient determine the request transport. Compare that path with the google-api-go-client transport behavior linked in the issue, then verify that GOOGLE_CLOUD_QUOTA_PROJECT results in the expected X-goog-user-project header and add coverage for the behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, google-cloud
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100