Integrate using Google Cloud console
Create resources manually in Google Cloud console
Open the project to integrate with in the Google Cloud console
Select a project where you would like Masthead to monitor you BigQuery resources. Use this project to create all the following cloud resources.
Create Pub/Sub resources
Go to Pub/Sub. Click Create Topic.
Set Topic ID as
masthead-topic
. Remove checkbox for Add a default subscription.

Navigate into the newly created. Click Create Subscription
Set Subscription ID as
masthead-agent-subscription
Select Cloud Pub/Sub topic as
masthead-topic
, then scroll down a little ...Set Acknowledgement deadline as
60 seconds
Click Create and we are all done with Pub/Sub topic and Subscription.

Create Logs Router
Go to Logging -> Log router
Click Create sink at the of the page and fill in the required fields:
Sink name:
masthead-agent-sink
Sink destination: Cloud Pub/Sub topic
Select a newly created Pub/Sub topic:
masthead-topic

Choose logs to include in the sink: copy the filter text below and paste it into the field.
protoPayload.methodName="google.cloud.bigquery.storage.v1.BigQueryWrite.AppendRows" OR "google.cloud.bigquery.v2.JobService.InsertJob"
OR "google.cloud.bigquery.v2.TableService.InsertTable"
OR "google.cloud.bigquery.v2.JobService.Query"
resource.type ="bigquery_table" OR resource.type ="bigquery_dataset" OR resource.type ="bigquery_project"

Click Create Sink

Grant roles to Masthead Service Account
Go to IAM & Admin -> IAM
Click on Grant access
In the New principals field enter
[email protected]
Click on Select a role and enter
BigQuery Metadata Viewer
. SelectBigQuery Metadata Viewer
role.Repeat for
BigQuery Resource Viewer
andPub/Sub Subscriber
.Click Save
Grant Masthead Service Account to get insights quickly using retrospective metadata
Masthead can provide you with insights within a few hours after integration by parsing retrospective logs and creating a data model around them.
This step enables Masthead to look up recently produced events in the Google Cloud logs that correspond to the Cloud Logs sink filter.
Go to IAM & Admin -> IAM
Click on Grant access
In the New principals field enter
[email protected]
Click on Select a role and enter
Private Logs Viewer
.Select
Private Logs Viewer
role.Click Save
Continue integration on the UI
Go back to Deployment page, click Verify custom deployment and enter the project ID.
Click Check permissions and connect.
Last updated