Inferensys

Glossary

Lineage Harvesting

Lineage harvesting is the automated process of extracting lineage metadata from various sources to build a comprehensive map of data dependencies.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
DATA OBSERVABILITY AND QUALITY POSTURE

What is Lineage Harvesting?

Lineage harvesting is the automated, foundational process for building data lineage, a critical component of data observability and governance.

Lineage harvesting is the automated process of extracting and collecting metadata about data's origin, movement, and transformation from various operational sources. It systematically parses artifacts like SQL scripts, workflow definitions (e.g., Airflow DAGs), and job execution logs to infer dependencies. This harvested metadata is then synthesized to construct a dependency graph, which visually maps how data flows from sources through transformations to final consumers, enabling impact analysis and root cause analysis (RCA).

The process targets multiple sources to ensure high lineage fidelity. Static lineage is harvested by analyzing code repositories and configuration files, while dynamic lineage is captured by instrumenting runtime execution. Harvesters integrate with tools like OpenLineage to standardize metadata. The result feeds data catalogs and observability platforms, providing the backbone for tracking upstream and downstream dependencies, detecting lineage breaks, and ensuring full data traceability across complex, heterogeneous pipelines.

MECHANISMS

Core Characteristics of Lineage Harvesting

Lineage harvesting is the automated process of extracting lineage metadata from various sources, such as SQL parsers, workflow orchestrators, and data processing engines. Its core characteristics define how it achieves comprehensive, actionable data observability.

01

Automated Metadata Extraction

Lineage harvesting automates the collection of lineage metadata from disparate systems without manual intervention. This is achieved by integrating with:

  • SQL Parsers to analyze query logic and infer column-level dependencies.
  • Workflow Orchestrators (e.g., Apache Airflow, Dagster) to capture job execution graphs.
  • Processing Engines (e.g., Spark, dbt) to extract transformation logic from runtime plans. Automation is critical for scale, ensuring lineage remains current as pipelines evolve.
02

Multi-Source Integration

Effective lineage harvesting connects to a heterogeneous technology stack to build a unified lineage graph. It integrates metadata from:

  • Databases & Warehouses (e.g., Snowflake, BigQuery) for table and view dependencies.
  • SaaS Applications (e.g., Salesforce, HubSpot) via API connectors.
  • BI & Visualization Tools (e.g., Tableau, Looker) to map report-to-data dependencies.
  • Code Repositories (e.g., Git) to analyze pipeline definition files for static lineage. This creates cross-system lineage, breaking down data silos.
03

Static vs. Dynamic Harvesting

Harvesting employs two complementary methods to maximize lineage fidelity:

  • Static Lineage: Derived by analyzing source code, SQL scripts, and configuration files without execution. It reveals intended dependencies but may miss runtime logic.
  • Dynamic Lineage: Captured by instrumenting jobs during execution. It provides an accurate record of actual data flow, including runtime parameters, data volumes, and conditional branches. The most robust systems combine both for a complete picture of design and operational truth.
04

Granularity of Capture

The lineage granularity defines the level of detail captured, which dictates the utility for debugging and impact analysis. Harvesting systems target:

  • Job/Table-Level: Tracks dependencies between entire datasets or pipeline tasks. Useful for high-level impact analysis.
  • Column-Level: Tracks the flow and transformation of individual data columns. Essential for debugging specific data issues and understanding business logic.
  • Row/Cell-Level (Emerging): Aims to trace the provenance of individual data records, offering the highest fidelity for audit and compliance but requiring significant instrumentation.
05

Standardized Metadata Emission

To avoid vendor lock-in and enable ecosystem interoperability, modern lineage harvesting aligns with open standards. The predominant standard is OpenLineage, which defines:

  • A common facet-based schema for lineage events (run, job, dataset).
  • Protocols for emitting events as JSON over HTTP or via message queues.
  • Integration points for collectors in various data platforms. Adopting OpenLineage allows harvested metadata to be consumed by any compatible observability platform or data catalog.
06

Continuous and Event-Driven

Lineage harvesting operates as a continuous, event-driven process, not a periodic batch job. This ensures real-time observability. Key patterns include:

  • Triggering on Pipeline Events: Harvesting initiates on events like 'job start', 'task complete', or 'query execution'.
  • Streaming Metadata: Lineage events are streamed to a central metadata store as soon as they are captured.
  • Automated Graph Updates: The central dependency graph is updated in near real-time, enabling immediate impact analysis and root cause analysis (RCA) when issues arise.
TECHNICAL OVERVIEW

How Lineage Harvesting Works: A Technical Process

Lineage harvesting is the automated, systematic extraction of metadata to construct a data lineage graph. It is the foundational data collection phase that powers lineage visualization, impact analysis, and root cause investigation.

Lineage harvesting is an automated process that extracts metadata from disparate systems to map data dependencies. It employs parsers for SQL and code, APIs for orchestration tools like Apache Airflow, and runtime agents within processing engines like Spark. This collected metadata—detailing sources, transformations, and destinations—is normalized into a standard schema, such as OpenLineage, and stored in a central metadata repository. This creates the raw material for the dependency graph.

The process operates across two primary modes: static analysis of code artifacts and dynamic instrumentation of job execution. Harvesters must reconcile these views to build a complete picture, identifying upstream dependencies and downstream consumers. High-fidelity harvesting achieves column-level lineage, tracing individual data elements. The resulting graph enables critical observability functions, including impact analysis for proposed changes and rapid root cause analysis (RCA) for data incidents.

METADATA ORIGINS

Common Sources for Lineage Harvesting

Lineage harvesting is an automated process that extracts dependency metadata from various points within the data stack. These sources provide the raw information needed to construct a complete dependency graph.

01

SQL Query Parsers

SQL parsers are the most common source for harvesting column-level and table-level lineage. They statically analyze SQL scripts (e.g., from dbt, stored procedures, BI tools) to extract SELECT, JOIN, and INSERT statements.

  • Examples: Parsing dbt .sql model files, Airflow SQL operators, or LookML/Tableau queries.
  • Key Output: Maps source tables/columns to target tables/columns based on the query logic.
  • Limitation: Cannot capture dynamic SQL generated at runtime without execution tracing.
02

Workflow Orchestrators

Orchestrators like Apache Airflow, Dagster, and Prefect provide DAG (Directed Acyclic Graph) definitions that specify task dependencies. Harvesting from these systems yields job-level lineage.

  • Examples: Extracting task_id dependencies and sensor triggers from an Airflow DAG's Python code.
  • Key Output: Understands the order of execution and which datasets are produced by which tasks.
  • Integration: Often combined with SQL parsing from tasks to connect job flow with data flow.
03

Data Processing Engines (Runtime)

Harvesting lineage at runtime from engines like Apache Spark, Flink, or cloud data warehouses (Snowflake, BigQuery) provides dynamic, high-fidelity lineage.

  • Mechanism: Uses listener APIs or query execution plans. For example, Spark's QueryExecution object or Snowflake's ACCESS_HISTORY.
  • Key Advantage: Captures what actually executed, including runtime parameters, data volumes, and conditional logic missed by static analysis.
  • Use Case: Essential for debugging failed jobs and understanding actual resource consumption.
04

Data Catalogs & Metadata Stores

Centralized catalogs (e.g., Amundsen, DataHub, OpenMetadata) and cloud-native metastores (AWS Glue, Unity Catalog) act as aggregation points for harvested lineage.

  • Role: They consume lineage from other sources via APIs (like OpenLineage) and serve as the system of record.
  • Key Function: Provide a unified graph by linking harvested technical lineage with business metadata (owners, descriptions, tags).
  • Harvesting Target: The catalog itself can be a source when integrating multiple lineage tools.
05

BI & Analytics Tools

Business Intelligence platforms (e.g., Tableau, Power BI, Looker) are critical sources for understanding the last mile of data consumption.

  • What's Harvested: Dashboard and report dependencies on underlying datasets, tables, and columns.
  • Method: Parsing workbook files (.twb, .pbix) or querying tool metadata APIs.
  • Business Impact: Enables impact analysis for schema changes—showing which reports will break if a source column is modified.
06

Code Repositories & CI/CD

Version control systems (Git) and CI/CD pipelines are sources for harvesting lineage defined as code, ensuring lineage reflects the deployed state.

  • Process: Scanning repository branches for SQL, YAML pipeline definitions, and dbt projects during merge or build processes.
  • Key Benefit: Links lineage to specific code commits, enabling historical tracking and rollback analysis.
  • Practice: Part of DataOps, where lineage harvesting is integrated into the deployment lifecycle.
METHOD COMPARISON

Static vs. Dynamic Lineage Harvesting

This table compares the two primary methodologies for extracting data lineage metadata, highlighting their operational characteristics, accuracy, and use cases.

FeatureStatic Lineage HarvestingDynamic Lineage Harvesting

Core Mechanism

Analyzes source code, SQL scripts, and configuration files.

Instruments and monitors pipeline execution at runtime.

Harvesting Trigger

Code commit, pipeline deployment, or scheduled scan.

Job execution event (e.g., DAG run, query execution).

Lineage Fidelity

Reflects designed or intended data flow.

Reflects actual runtime data flow and volumes.

Captures Runtime Parameters

Impact on Pipeline Performance

Adds minimal instrumentation overhead (< 1% latency).

Requires Code Execution

Primary Use Case

Impact analysis for proposed changes, documentation.

Root cause analysis for failures, compliance auditing.

Detection of Logic-in-Code

Detection of Logic-in-Data

Typical Implementation Complexity

Medium (requires robust parsers).

High (requires integration with execution engines).

DATA LINEAGE AND DEPENDENCY MAPPING

Frequently Asked Questions

Lineage harvesting is the automated, foundational process for building data lineage. These questions address its mechanisms, importance, and practical implementation.

Lineage harvesting is the automated process of extracting metadata about data origins, movements, and transformations from various operational sources to construct a data lineage graph. It works by integrating with and parsing metadata from systems like SQL query engines, workflow orchestrators (e.g., Apache Airflow, Dagster), and data processing frameworks (e.g., Spark, dbt). Techniques include static analysis of code and scripts to infer dependencies and runtime instrumentation to capture actual execution paths and data volumes. The harvested metadata—including source and target tables, transformation logic, and job execution contexts—is then standardized and stored in a metadata catalog to build a comprehensive, queryable map of data dependencies.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.