dbt Data Lineage: From Your Project’s DAG to Your Entire Stack
Quick definition: dbt data lineage
dbt data lineage is the dependency graph dbt builds from the ref() and source() calls in your project. It shows which sources and models feed each model, and what sits downstream of it, as a directed acyclic graph (DAG). It is data lineage for everything your dbt project declares.
If you run dbt, you already have lineage: Every ref() and source() call adds an edge to a graph that dbt builds for you, and for many teams it is the most trusted map of their data, because it comes straight from the code that produces the tables.
That graph describes your project, but your data usually travels further than that: It starts in the systems that load your sources, and it ends in the dashboards, machine learning models, and AI agents that read your marts. Getting the most from dbt lineage means knowing how to read it inside the project, and then connecting it to the systems on either side.
How does dbt track data lineage?
dbt tracks data lineage as a side effect of how you write models. You don’t draw the graph or maintain it. You declare dependencies in SQL, and dbt works out the rest.
Two functions do the work:
source()points a model at a raw table that something outside dbt loaded into your warehouse.ref()points a model at another model, seed, or snapshot in the project.
When dbt parses the project, it resolves every one of those calls into an edge and assembles a DAG. That DAG decides build order, and it doubles as your lineage graph. Because the graph is generated from the code on every parse, it stays in step with the project without anyone updating a diagram.
Models aren’t the only nodes: Sources, seeds, snapshots, and tests all sit on the graph, and so do exposures, which declare a downstream use of your models such as a dashboard or an application. On the dbt platform, exposures for supported BI tools can also be generated automatically.
dbt writes the whole graph to a file called manifest.json each time it parses or compiles the project. That artifact is worth remembering, because any tool that wants to read your dbt lineage starts there.
How do you track data lineage in dbt?
If you’re an analytics engineer trying to trace where a model’s data comes from, or what a change will touch, dbt gives you several ways in. Which one fits depends on whether you need model-level or column-level detail, and on where you run dbt.
- From the command line: Graph operators select a model’s ancestors, its descendants, or both. Running
dbt ls --select "+orders"listsordersand everything upstream of it,"orders+"lists everything downstream, and"+orders+"returns both directions. The graph operators reference covers the full syntax. - In dbt Docs:
dbt docs generatefollowed bydbt docs servebuilds a documentation site with an interactive lineage graph. This is how most people first see their DAG. It shows model-level lineage. - In Catalog on the dbt platform: Catalog adds column-level lineage on a resource’s Columns tab, so you can follow one field through each model that selects it.
- Locally with dbt v2: dbt v2 can produce column-level lineage on your own machine when you compile with strict static analysis. You can view it in the dbt VS Code extension, in dbt Docs v2, or from the command line.
| Option | Where it runs | Lineage level | What you need |
Graph operators with dbt ls | Command line | Model | Any dbt project |
| dbt Docs | Local or self-hosted site | Model | dbt docs generate and dbt docs serve |
| Catalog | dbt platform | Model and column | Enterprise or Enterprise+ plan for column-level lineage |
| dbt v2 local tooling | Your machine | Model and column | dbt v2 with strict static analysis |
Whichever view you use, the practical jobs are the same. Before a change, you look downstream to see what depends on the model you’re editing. After a failure, you look upstream to find where the bad data entered.
Where does a dbt lineage graph end?
A dbt lineage graph covers what your dbt project declares, so it ends where the project ends. Picture a revenue model three layers into your marts. dbt can show you every staging model and source table behind it. What loaded that source table, and who reads the finished mart, sit outside the code dbt parses.
Three kinds of dependency sit on the far side of that boundary:
- Upstream of
source(): The ingestion jobs, operational databases, and event streams that load your raw data sources. - Beside the project: Pipelines that run in an orchestrator, a Spark job, or a second dbt project that another team owns.
- Downstream of your marts: Dashboards, reverse ETL syncs, machine learning features, and AI agents that query the tables you build.
None of this is a flaw in dbt. A transformation tool maps transformations. But it does mean that the questions with the highest stakes, such as what happens if a column is dropped, often have answers that cross the boundary.
“Most teams do not lack lineage—they lack connected lineage.”
Manuela WeiPrincipal Product Manager, DataHub
DataHub Product Manager Manuela Wei’s point in Data Lineage: What It Is and Why It Matters is that teams tend to hold several partial views from several tools, and the dependencies that matter most fall in the gaps between them. dbt’s graph is usually the best of those views. The work is in joining it to the others.
Declared lineage and derived lineage: what’s the difference?
Declared lineage and derived lineage are two ways of building the same graph, and it helps to know which one you’re looking at.
What declared lineage shows
dbt’s model graph is declared lineage. Each edge exists because a developer wrote ref() or source(). That is why teams trust it: the graph is intentional, reviewed in pull requests, and versioned alongside the models.
The flip side is that a declared graph can only contain what was declared. Suppose a model selects from analytics.raw.orders by its full table name, perhaps in a quick fix that was never tidied up. The query runs and the table builds, but no ref() or source() call exists for that dependency, so the edge never reaches the DAG.
What lineage derived from SQL adds
Derived lineage comes from reading the SQL itself. A parser works through the compiled query, finds every table and column it reads from, and builds edges from what the statement does.
At column level, this is how lineage works everywhere. dbt’s own column-level lineage is parsed from the select statements in your models. The distinction matters at model level, where dbt’s graph is declared and a SQL parser offers a second way to produce it.
Choosing which one DataHub uses
DataHub can build dbt lineage either way. By default it uses dbt’s own metadata for table-level lineage, which keeps the graph you already trust. An ingestion option, prefer_sql_parser_lineage (which also requires skip_sources_in_lineage), tells DataHub to take each model’s lineage from its schema-aware SQL parser instead. DataHub’s dbt source documentation describes it as useful when models reference tables directly instead of through ref().
It is a choice between two sources. For each model, DataHub uses one or the other and doesn’t compare them: with the option on, it uses the parser’s result and falls back to dbt’s metadata only when a model’s SQL can’t be parsed. Pick the one that matches how your project is written.
How DataHub connects dbt lineage to the rest of your stack
dbt is one of DataHub’s most popular integrations, and the two are built to work together. DataHub reads the lineage dbt already produces, adds column-level detail, and places it in one graph with your warehouse, your BI tools, and the pipelines that run outside dbt.
dbt lineage tells you what your project declares, and it’s the right place to start. DataHub reads that graph, adds column-level lineage from your compiled SQL, and joins it to the rest of your stack. With your warehouse, ingestion and BI tools connected, you can see what feeds your sources and what depends on your models, down to the dashboard, before you change a column.
Ingest your dbt artifacts
DataHub has two ingestion sources for dbt: dbt, which reads the artifact files your dbt runs produce, and dbt-cloud, for teams on the dbt platform. Either way, the input is the metadata dbt already generates.
| Artifact | Required | What DataHub gets from it |
manifest.json | Yes | Models, sources, seeds, snapshots, tests, exposures, and lineage |
catalog.json | No | Column schemas and table statistics |
sources.json | No | Source freshness |
run_results.json | No | Test results and model run timing |
DataHub’s dbt source documentation has the full recipe and configuration options.
Ingestion is batch. Schedule it to run after each dbt job, and DataHub reflects the project as of that run.
One page for the model and its warehouse table
A dbt model and the table it materializes are the same asset seen from two tools. Run ingestion for both dbt and your warehouse, in either order, and DataHub links the pair as sibling nodes.
The model’s SQL, tests, and documentation appear alongside the table’s schema, usage, and statistics on one page, and lineage runs from the model to its table, so a path continues from your sources through dbt to your dashboards.
Set incremental_lineage: true in your warehouse ingestion, such as Snowflake or BigQuery, as well. It defaults to false there, so otherwise each warehouse run replaces the lineage dbt added to your tables and cuts the path from your models to their downstream dashboards.
The sibling link is also what attaches your dbt graph to the rest of your stack. Once the warehouse is connected, anything else that reads or writes those tables joins the same graph.
Column-level lineage by default
Column-level lineage for dbt is on by default in DataHub through the include_column_lineage setting. DataHub parses it from your compiled SQL, and it ships in both DataHub Core and DataHub Cloud.
Tests, exposures, and meta come with it
Lineage is more useful with context attached, and DataHub brings the rest of your dbt metadata along:
- Tests arrive as assertions, with results when you supply
run_results.json - Exposures arrive as dashboards
metaproperties become tags, glossary terms, owners, domains, and structured properties throughmeta_mapping
DataHub Cloud adds column-level glossary term propagation along lineage, AI-generated documentation, and the Ask DataHub agent.
Lineage beyond dbt
For pipelines that don’t run through dbt, DataHub’s Airflow plugin and OpenLineage support send lineage as jobs run. Add connectors for your ingestion and BI tools from DataHub’s library of 150+ integrations, and the graph covers the full path from source system to dashboard.
What connected dbt lineage lets you do
Connected lineage pays off wherever a question crosses the project boundary. Three situations come up most.
See what depends on a column before you drop it
Changing or removing a column is the classic case. dbt tells you which models select it. A connected graph continues through the warehouse table to each dashboard and data product that reads it, so you can warn the owners before the change ships.
Trustpilot runs dbt alongside BigQuery, Airflow, and Looker, with more than 500,000 data assets and nearly 500 Looker dashboards cataloged in DataHub. When it migrated from MongoDB to Amazon DocumentDB, its team used lineage to trace the downstream impact in minutes. “Lineage is one of the really big selling points,” says Hugo Hobson, Senior Data Engineer at Trustpilot.
Trace an incident past the project boundary
When a dbt test fails or a number looks wrong, the cause is often upstream of source(): a late load, a schema change in an operational database, or a failed ingestion job. With those systems on the same graph, you can follow the problem back to where it started and see everything else it touched.
That shortens incidents. The March 2026 IDC Business Value of DataHub Cloud study found that organizations using DataHub Cloud resolved data-related outages 58% faster.
Give AI agents lineage they can route on
AI agents raise the stakes on accuracy. An engineer who meets a suspicious edge in a lineage graph stops and checks. An agent choosing which table answers a question follows the edge it’s given and reports the result with confidence.
Miro has more than 20,000 datasets across Snowflake, dbt, and Looker. It doesn’t use the dbt platform, so DataHub became the place its analytics agent could reach dbt model metadata, served through DataHub’s MCP Server. On 900 benchmark questions written by its own experts, Miro’s text-to-SQL accuracy rose from under 40% to over 90%.
Start with dbt, then connect it
dbt’s lineage graph is the right place to start, and for work inside the project it may be all you need. When the questions reach your sources, your dashboards, or your agents, connect that graph to the systems around it.
See how DataHub builds cross-platform data lineage, or read how the same approach works for Snowflake, Databricks, and BigQuery.
FAQs
Does dbt do data lineage?
Does dbt do data lineage?
Yes. dbt builds a data lineage graph automatically from the ref() and source() calls in your models. You can view it in dbt Docs, in Catalog on the dbt platform, or from the command line, and it covers every resource in your dbt project.
What is a data lineage example?
What is a data lineage example?
A simple example in dbt: a stg_orders model selects from a raw orders source, a fct_revenue model selects from stg_orders, and a revenue dashboard queries fct_revenue. The lineage is the chain from the source table through both models to the dashboard. Tracing it tells you where a revenue figure came from and what breaks if orders changes.
Why is data lineage important?
Why is data lineage important?
Data lineage is important because it shows data teams how data flows from source to consumption. That supports three jobs: impact analysis before a change, root cause analysis when data quality drops, and data discovery, since a table’s origins help people decide whether to trust it. In a dbt project, the lineage graph covers all three for the models you build.
Does dbt Core support column-level lineage?
Does dbt Core support column-level lineage?
Not in the open-source build. dbt Core, now called dbt v1, and its legacy dbt Docs site show model-level lineage. Column-level lineage comes with the free dbt v2 distribution, not the Apache 2.0 dbt OSS build, and is generated locally with strict static analysis and viewable in dbt Docs v2. You can also ingest your dbt artifacts into DataHub Core, which includes column-level lineage for dbt by default.
Can dbt data lineage include tools outside your dbt project?
Can dbt data lineage include tools outside your dbt project?
dbt’s graph covers the data models and other resources your project declares, including exposures for downstream uses. To see ingestion jobs, other pipelines, and consumers in the same graph, bring your dbt metadata into a platform such as DataHub that also connects to those systems.
Do you need the dbt platform to send dbt lineage to DataHub?
Do you need the dbt platform to send dbt lineage to DataHub?
No. DataHub’s dbt source reads the artifact files that any dbt project produces, starting with manifest.json. Teams on the dbt platform can use the dbt-cloud source instead.
Is column-level lineage for dbt available in DataHub Core?
Is column-level lineage for dbt available in DataHub Core?
Yes. Column-level lineage for dbt is on by default and ships in both DataHub Core and DataHub Cloud.
How often does dbt lineage update in DataHub?
How often does dbt lineage update in DataHub?
dbt ingestion is batch, so lineage updates each time ingestion runs. Most teams schedule it after every dbt job. For data pipelines outside dbt, the Airflow plugin and OpenLineage send lineage to DataHub as jobs run.
Does DataHub replace dbt Docs or Catalog?
Does DataHub replace dbt Docs or Catalog?
No. dbt’s tools are where you develop and review lineage inside your project. DataHub reads that lineage and connects it to your warehouse, BI tools, and other pipelines, so the two work together.


