Quota project fix#8987
Conversation
4b27788 to
b214ccb
Compare
b214ccb to
8883191
Compare
| user: ${USERID} | ||
| user: $USERID |
There was a problem hiding this comment.
what is a reason for this change? To be syntactically correct the original line should be enclosed with quotes.
There was a problem hiding this comment.
The change is to be consistent with L35. Either style should be equivalent.
To be syntactically correct the original line should be enclosed with quotes.
I'm not sure what you mean, what is wrong with this syntax?
| # export GOOGLE_APPLICATION_CREDENTIALS=$HOME/.config/gcloud/application_default_credentials.json | ||
| # docker compose -f docker-compose.yaml -f docker-compose.adc.yaml up | ||
| # GOOGLE_CLOUD_PROJECT="otel-quickstart-demos" \ | ||
| # GOOGLE_APPLICATION_CREDENTIALS="$HOME/.config/gcloud/application_default_credentials.json" \ |
There was a problem hiding this comment.
what is a reason to advertise the anti-pattern of using the GSA key file for authentication?
the doc samples use the main use case which is to run the sample on Google Cloud.
There was a problem hiding this comment.
This is to allow users to run the example on their own machine. We are not recommending this pattern in the docs, just making it possible.
| user: $USERID | ||
| volumes: | ||
| - ${GOOGLE_APPLICATION_CREDENTIALS:-/dev/null}:/tmp/keys/gcp-credentials.json:ro | ||
| - ${GOOGLE_APPLICATION_CREDENTIALS?}:${GOOGLE_APPLICATION_CREDENTIALS}:ro |
There was a problem hiding this comment.
if I am not mistake this syntax results in failing if the GOOGLE_APPLICATION_CREDENTIALS env var is not set.
what is a reason for using this construct in the code sample? see my previous comment about using anti-patterns
There was a problem hiding this comment.
Correct that is the purpose, to alert the user they need the environment variable with this docker compose file. If they want to get credentials from the environment (which doesn't work on a local machine), they can use the other compose file. The two options are explained in the README and in the devsite docs.
|
Closing in favor of moving this into opentelemetry-operations-java. |
Description
Cloud Trace API requires a quota project. This change passes through
GOOGLE_CLOUD_QUOTA_PROJECTenvironment variable, which Cloud Shell has automatically set. This is better than doing the resource project override and works better off Cloud Shell. I also renamed the file to reflect that it works with any credentials file, including SA keys.Equivalent of GoogleCloudPlatform/golang-samples#3760 from the Go repo
Checklist
pom.xmlparent set to latestshared-configurationmvn clean verifyrequiredmvn -P lint checkstyle:checkrequiredmvn -P lint clean compile pmd:cpd-check spotbugs:checkadvisory only