Environment sizing
To estimate the scale of your infrastructure, gather two key metrics from your Google Cloud environment:
- the total number of tables
- and the expected volume of BigQuery logs that Masthead processes.
1. Total number of tables
Section titled “1. Total number of tables”Use Cloud Asset Inventory to easily count BigQuery tables across multiple regions.
Use the Google Cloud console
Section titled “Use the Google Cloud console”- Open Cloud Asset Inventory in the Google Cloud console.
- Apply the filter Resource type =
bigquery.Tableto view the total count.
Use the gcloud command-line tool
Section titled “Use the gcloud command-line tool”Run the following command, replacing <YOUR-PROJECT-ID>. For multiple projects, either sum the results or change --scope to your folder/organization level:
gcloud asset search-all-resources \ --scope="projects/<YOUR-PROJECT-ID>" \ --asset-types="bigquery.googleapis.com/Table" \ --format="value(name)" | wc -l2. Total number of BigQuery logs
Section titled “2. Total number of BigQuery logs”Masthead uses Google Cloud Logging to process metadata and analyze your BigQuery environment. To estimate the expected log volume:
-
Go to the Logs Explorer in the Google Cloud console.
-
Refine the logs scope to ensure that you select the Google Cloud projects to integrate with Masthead.
-
Set the time range in the top right corner to Last 30 days.
-
In the query builder, apply the following log filter:
(protoPayload.methodName="google.cloud.bigquery.storage.v1.BigQueryWrite.AppendRows" ORprotoPayload.methodName="google.cloud.bigquery.storage.v1.BigQueryWrite.ReadRows" ORprotoPayload.methodName="google.cloud.bigquery.v2.JobService.GetQueryResults" ORprotoPayload.methodName="google.cloud.bigquery.v2.JobService.InsertJob" ORprotoPayload.methodName="google.cloud.bigquery.v2.JobService.Query" ORprotoPayload.methodName="google.cloud.bigquery.v2.TableDataService.List" ORprotoPayload.methodName="google.cloud.bigquery.v2.TableService.InsertTable") AND (resource.type="bigquery_table" ORresource.type="bigquery_dataset" ORresource.type="bigquery_project") -
Click Run query.
-
Under the Histogram panel and preceding the log list there is
X results- a total number of matched log entries over the selected period. -
Note the total count of matched logs and share this information with the Masthead team.