examples(gcp): add BigQuery REST API integration example#624
Open
dpacheconr wants to merge 2 commits intonewrelic:masterfrom
Open
examples(gcp): add BigQuery REST API integration example#624dpacheconr wants to merge 2 commits intonewrelic:masterfrom
dpacheconr wants to merge 2 commits intonewrelic:masterfrom
Conversation
Adds bq-rest.yml as a complementary approach to the existing bq.yml. Uses the BigQuery REST API directly with an OAuth2 bearer token via gcloud application-default credentials, making it suitable for environments without the bq CLI (containers, restricted hosts). Updates README to cover both approaches with a comparison table.
Adds comment explaining that gcloud caches the OAuth2 token locally and only refreshes near expiry, so there is no network overhead on most Flex polls.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bq-rest.ymlas a complementary BigQuery integration using the BigQuery REST API directly, alongside the existingbq.ymlwhich uses thebqCLIbqCLI is not available (containers, restricted hosts)lookupfeature to chain an OAuth2 bearer token (fetched viagcloud auth application-default print-access-token) into subsequent HTTP API calls — gcloud caches the token locally so there is no network overhead on most pollsREADME.mdwith a comparison table and separate sections for each approachNew events reported
bq_rest_table_statsbq_rest_storage_statsTest plan
project_idanddataset_idinvariable_storegcloud auth application-default loginon test host[sudo] /opt/newrelic-infra/newrelic-integrations/bin/nri-flex --verbose --pretty --config_file bq-rest.ymlbq_rest_table_statsandbq_rest_storage_statsevents appear in NRDBbq.ymlis unchanged and still works