BigQuery setup guide
1. Creating a Service Account User in BigQuery
Follow these steps to create a new service account user for Paradime and grant the required permissions at the project level:- Go to Google Cloud Console and navigate to IAM & Admin:
- Select your project from the project selector at the top.
- Go to the “IAM & Admin” section.
- Create Service Account:
- Click on “Service Accounts”.
- Click “Create Service Account”.
- Enter the Service Account name (e.g.,
paradime-radar-user). - Click “Create and Continue”.
- Assign Roles:
- Assign the necessary roles to the service account:
BigQuery Resource ViewerBigQuery Job User
- Assign the necessary roles to the service account:
- Complete and Save:
- Click “Done” after assigning the roles.
- The service account will now be created with the assigned permissions.
- Generate Key:
- Go to the “Keys” tab and click “Add Key” -> “Create New Key”.
- Choose JSON format and save the key file securely. (We will need this later to connect BigQuery to Paradime.)
2. Create the BigQuery Dataset
Make sure to name the BigQuery Dataset as
paradime_cost_analytics- Go to Google Cloud Console, navigate to BigQuery and select your project.
- Create a Dataset:
- Name:
paradime_cost_analytics - Select the appropriate Dataset region (this will be needed for the Paradime connection setup).
- Name:
- Grant Access:
- Assign the
BigQuery UserandBigQuery Data Editorroles to the service account user created previously, ensuring these permissions are at the Dataset level.
- Assign the
3. Setting up a Logs Routing Sink
Make sure to use
paradime_cost_analytics as the destination dataset for the Logs Routing Sink.- In the Google Cloud console, go to the Log Router page. If you use the search bar to find this page, then select the result whose subheading is Logging.
- Select the Google Cloud project in which the log entries that you want to route originate.
- Select Create sink.
- In the Sink details panel, enter the following details:
- Sink name: Provide an identifier for the sink; note that after you create the sink, you can’t rename the sink but you can delete it and create a new sink.
- Sink description (optional): Describe the purpose or use case for the sink.
- In the Sink destination panel, select the sink service and destination by using the Select sink service menu.
- Select BigQuery dataset: Select the data set name
paradime_cost_analytics(created in the previous step) to receive the routed log entries. - Select the option ot partition tables
- Select BigQuery dataset: Select the data set name
- Go to the Choose logs to include in sink panel and specify the log entries to include:
- Select Create sink.
Set the partition expirationAfter the Logs Router Sink table has been created, you can setup an expiration for partitions older than 7 days.
Connecting multiple BigQuery Projects to Paradime?
Connecting multiple BigQuery Projects to Paradime?
If you plan to connect multiple BigQuery Projects to Paradime, follow these steps for each project:
1. Grant Access to the BigQuery Project
Using the existing service account you from step 1, Creating a Service Account, complete the following:- Go to Google Cloud Console and navigate to IAM & Admin.
- Select your project from the project selector at the top.
- Go to the “IAM & Admin” section and select “IAM”.
- Assign Roles:
- Select “Grant Access”.
- Assign the following roles to the service account created initially:
BigQuery Resource ViewerBigQuery Job User
2. Create the BigQuery Dataset in Each Project
Similar to step 2, Create the BigQuery Dataset, complete the following:- Go to Google Cloud Console, navigate to BigQuery, and select your project.
- Create a Dataset:
- Name:
paradime_cost_analytics - Ensure the Paradime Dataset region is the same across all BigQuery projects.
- Name:
- Grant Access:
- Assign the BigQuery User and BigQuery Data Editor roles to the service account user created previously.
- Ensure these permissions are granted at the Dataset level.
3. Setting up a Logs Routing Sink for each BigQuery Project
Similar to step 3, Setting up a Logs Routing Sink, complete the same process again, for each BigQuery Project to route Logs in their respective BigQuery Dataset in Each Project calledparadime_cost_analytics4.. Create and configure a GCS Bucket
- Navigate to Cloud Storage and select Buckets
- Click “Create”.
- Name your GCS bucket (e.g.,
paradime-bucket). - Select your Bucket region (e.g.,
US). - Click on “Create” to complete creating your GCS Bucket.
- Set lifecycle policy
- Go to the “Lifecycle” tab for your GCS Bucket.
- Select “Add Rule” -> “Delete Object” action.
- Set “Age” to 2 days and click “Create” to set the policy.
- Grant the Paradime service account user access to the GCS Bucket
- Go to the “Permissions” tab for your GCS Bucket.
- Add the Paradime Service Account user email as a “New Principal” and assign the
Storage Adminrole.
5. dbt™ project setup guide
To enable Paradime to enrich your BigQuery queries with additional metadata you will need to create a new dbt™️ macro calledget_query_comment.sql in the macros folder of your project.
- Create the Macro (
get_query_comment.sql)
get_query_comment.sql dbt™️ macro
get_query_comment.sql dbt™️ macro
get_query_comment.sql
- Update your dbt_project.yml file
dbt_project.yml
6. Configure Cost connection in Paradime
To connect Paradime to BigQuery for cost tracking, follow these steps:How to Add a BigQuery Cost Connection
- Click “Settings” in the top menu bar of the Paradime interface.
- Click “Connections” in the left sidebar.
- Click “Add New” next to the Radar Environment.
- Select “BigQuery” as the connection type.
Enter the Required Details
Once you have selected BigQuery, provide the following details to complete the setup:- BigQuery Service Account JSON
- BigQuery Project IDs
- Dataset Location for the dataset used by Paradime
- GCS Bucket Name used by Paradime
Important Note:If connecting multiple projects, separate each BigQuery Project ID using commas (
✅
❌
,) without spaces:✅
dev-project,staging-project,production-project❌
dev-project, staging-project, production-project