Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/snippets/cloud/integrations/bigquery.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Select a tab below and follow the steps for your chosen method.
For BigQuery, this translates to:
- **BigQuery Data Viewer** on the Elementary dataset (for reading Elementary schema data).
- **BigQuery Metadata Viewer** and **BigQuery Resource Viewer** at the **project level** (for reading `INFORMATION_SCHEMA.JOBS` query history and table metadata). These project-level roles are required for BI integrations like Hex that rely on query history.
- Optionally, **Data Lineage Viewer** at the **project level**, with the Data Lineage API enabled (for column-level lineage from BigQuery jobs).

### Fill the connection form

Expand Down
6 changes: 6 additions & 0 deletions docs/snippets/dwh/bigquery/cloud_wif.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import DataLineagePermissions from '/snippets/dwh/bigquery/data_lineage_permissions.mdx';

### Create a Workload Identity pool and provider:

1. In the Cloud Console, go to: IAM & Admin > Workload Identity Federation. Click 'CREATE POOL' (or select an existing pool), give it a name (e.g. `elementary-identity-pool`), and continue.
Expand Down Expand Up @@ -33,6 +35,10 @@
- **BigQuery Metadata Viewer**
- **BigQuery Resource Viewer**

### Optional: grant access to the Data Lineage API

<DataLineagePermissions />

### Grant principal access to specific datasets:

6. In the [BigQuery console](https://console.cloud.google.com/bigquery), find your Elementary dataset in the 'Explorer' tab. Click the three dots next to it > Share > ADD PRINCIPAL. Paste the same principalSet from step 4, select `BigQuery Data Viewer`, and save. If your dbt dataset is in a different project, also grant it `BigQuery Metadata Viewer` and `BigQuery Resource Viewer`.
Expand Down
12 changes: 12 additions & 0 deletions docs/snippets/dwh/bigquery/data_lineage_permissions.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Elementary uses the [Data Lineage API](https://cloud.google.com/dataplex/docs/about-data-lineage) for column-level lineage built from the jobs that run in BigQuery. Column-level lineage from your dbt project doesn't depend on this API. Without the API, Elementary still builds table-level lineage for BigQuery jobs from `INFORMATION_SCHEMA.JOBS`.

In **every project where your pipelines run queries**:

1. Enable the Data Lineage API: open [the API page](https://console.cloud.google.com/apis/library/datalineage.googleapis.com) and click **"Enable"**, or run:
```bash
gcloud services enable datalineage.googleapis.com --project=PROJECT_ID
```
2. In [IAM & Admin](https://console.cloud.google.com/iam-admin/iam), grant the same principal you granted the roles above the role **"Data Lineage Viewer"** (`roles/datalineage.viewer`) at the project level.
3. If the project that owns Elementary's credentials (the service account's project, or the workload identity pool's project) is not one of those projects, enable the Data Lineage API there too, the same way as in step 1.

BigQuery records lineage in the project where each job runs, so a missing role or a disabled API in one of those projects only removes column-level lineage for the jobs that ran there. If the API is disabled in the credentials project, Elementary gets no column-level lineage at all.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import DataLineagePermissions from '/snippets/dwh/bigquery/data_lineage_permissions.mdx';

### Grant service user access

In order for a service user to work with Elementary Cloud, it requires the following permissions:
Expand Down Expand Up @@ -27,6 +29,10 @@ These roles are required for Elementary to read query history (`INFORMATION_SCHE

5. **Repeat for any additional GCP projects** referenced in your dbt sources or used by BI tools (e.g., Hex, Looker) for query execution.

#### Optional: grant access to the Data Lineage API

<DataLineagePermissions />

#### Step 2: Grant dataset-level role on the Elementary dataset

This role provides read access to your Elementary schema data.
Comment on lines +34 to 38

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 No warning about lineage charges

Enabling the Data Lineage API starts billable processing and metadata storage for supported services with ingestion enabled. The writing guide calls for a warning before actions with side effects.

Devin left this for you to triage: I haven't verified Google's current billing for lineage ingestion after the API is enabled. If it is billed, add a Note linking Dataplex pricing before the enable step.

(Refers to this code)

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Expand Down
Loading