Area: Ingestion
Sub-Area: dbt Integration
Applies to: OSS + Cloud
Issue
dbt model metadata, including descriptions, tags, and lineage, does not appear in DataHub after you run the dbt ingestion source. This usually comes from a wrong manifest path, a missing target platform, or dbt URNs that do not match the URNs from your warehouse ingestion.
You Might Be Asking
- How do I ingest dbt metadata into DataHub?
- Why isn't my dbt lineage showing up?
- How do I match dbt models with my data warehouse tables?
Cause
DataHub links each dbt node to its warehouse table automatically, as siblings and through lineage. You do not create this link by hand. The link only works when the URNs the dbt recipe builds match the URNs from the warehouse ingestion. These settings must agree with the warehouse recipe:
target_platformtarget_platform_instanceenv- URN casing (
convert_urns_to_lowercase)
Solution
-
Set the required keys in the dbt recipe.
manifest_pathandtarget_platformare required.catalog_pathis optional, but it is highly recommended because without it some metadata, such as column info, is incomplete or missing.manifest_pathandcatalog_pathcan each be a local file or a URI.Example for dbt Core with a Snowflake target. Adapt
target_platformfor other warehouses.source: type: dbt config: manifest_path: "/path/to/target/manifest.json" catalog_path: "/path/to/target/catalog.json" run_results_paths: - "/path/to/target/run_results.json" target_platform: "snowflake" env: "PROD"Recipes reject unknown keys, so a key that is not a real config field makes the recipe fail validation before ingestion starts.
-
Generate fresh dbt artifacts.
dbt docs generateproducescatalog.json. The manifest is required.cd your-dbt-project dbt docs generate -
Match the platform instance of your warehouse. Set
target_platform_instancein the dbt recipe to the same value asplatform_instancein the warehouse recipe.target_platform_instanceis the platform instance of the warehouse, not an environment. Useenvfor the environment.Do not set the dbt recipe's own
platform_instanceto the warehouse value. That key names only the dbt side, and changing it changes every dbt URN of the project.source: type: dbt config: manifest_path: "/path/to/target/manifest.json" target_platform: "snowflake" target_platform_instance: "prod_snowflake" # same as platform_instance in the Snowflake recipe -
For dbt Cloud, use the
dbt-cloudsource.token,account_idandproject_idare required.job_idis required unless you enableauto_discovery. Take the account, project and job IDs from the job details page URL. Create the service token with the "Metadata Only" permission. See the dbt Cloud module docs.source: type: dbt-cloud config: account_id: 12345 project_id: 67890 job_id: 11111 token: "${DBT_CLOUD_TOKEN}" target_platform: "snowflake" -
Run both ingestions. You need ingestion for dbt and for the warehouse, and they can run in any order.
-
Check URN casing. By default dbt lowercases dataset URNs (
convert_urns_to_lowercaseis true). A dbt URN looks like this, and it includestarget_platform_instancewhen you set one:urn:li:dataset:(urn:li:dataPlatform:snowflake,database.schema.model_name,PROD)If your warehouse source keeps original casing, the URNs differ. The BigQuery source, for example, keeps original casing by default. For those platforms, set
convert_urns_to_lowercase: falsein the dbt recipe. Changing this value re-keys every dataset the recipe emits. With stateful ingestion enabled, the old-cased URNs are soft-deleted as stale and new ones are created. Pick one value and keep it. -
Column-level lineage is on by default.
include_column_lineagedefaults to true and requiresinfer_dbt_schemas, which also defaults to true. Do not add aload_schemaskey.
On DataHub Cloud, find your dbt source under Admin > Data Sources in the left navigation.