Data lineage tracker

From curiositech/windags-skills · View interactive version

Data lineage tracker is an AI agent skill from the GitHub repository curiositech/windags-skills. OpenLineage, DataHub, Marquez for data lineage tracking and impact analysis. Activate on: data lineage, OpenLineage, DataHub, Marquez, impact analysis, data catalog, column lineage, data discovery. NOT for: data quality validation (use data-quality-guardian), dbt documentation (use dbt-analytics-eng

How to use this skill

Skill file

Data Lineage Tracker

Implement end-to-end data lineage tracking using OpenLineage, DataHub, and Marquez for impact analysis, debugging, and compliance.

Activation Triggers

Activate on: "data lineage", "OpenLineage", "DataHub", "Marquez", "impact analysis", "data catalog", "column lineage", "data discovery", "data provenance", "downstream impact"

NOT for: Data quality checks → data-quality-guardian | dbt model documentation → dbt-analytics-engineer | Schema evolution → schema-evolution-manager

Quick Start

  1. Choose platform — DataHub (full catalog + lineage), Marquez (lineage-focused), Amundsen, OpenMetadata
  2. Instrument pipelines — integrate OpenLineage with Airflow, Spark, and dbt for automatic lineage
  3. Capture column-level lineage — trace which source columns feed which target columns
  4. Build impact analysis — before changing a table, see all downstream consumers
  5. Integrate with incidents — link data quality alerts to lineage for root cause analysis

Core Capabilities

| Domain | Technologies |

|--------|-------------|

| Lineage Standard | OpenLineage 1.x (open standard, LFAI) |

| Catalogs | DataHub 0.14+, OpenMetadata 1.5+, Amundsen |

| Lineage Backend | Marquez (OpenLineage reference), DataHub lineage |

| Integrations | Airflow OpenLineage, Spark OpenLineage, dbt, Great Expectations |

| Visualization | DataHub lineage graph, Marquez UI, dbt docs |

Architecture Patterns

OpenLineage Event Flow

Airflow Task              Spark Job                 dbt Model
     │                         │                         │
     ├─ START event ──→        ├─ START event ──→        ├─ START event ──→
     │                         │                         │
     ├─ RUNNING event ─→       ├─ RUNNING event ─→       │
     │                         │                         │
     ├─ COMPLETE event ─→      ├─ COMPLETE event ─→      ├─ COMPLETE event ─→
     │  (with I/O datasets)    │  (with I/O datasets)    │  (with I/O datasets)
     ↓                         ↓                         ↓
              ┌────────────────────────────────────┐
              │     OpenLineage Backend            │
              │  (Marquez / DataHub / custom)      │
              │                                    │
              │  Stores: job runs, datasets,       │
              │  input/output relationships,       │
              │  column-level lineage              │
              └────────────────────────────────────┘

Impact Analysis Query

# DataHub GraphQL: find all downstream dependencies of a dataset
query = """
{
  dataset(urn: "urn:li:dataset:(urn:li:dataPlatform:snowflake,prod.fct_orders,PROD)") {
    downstream: relationships(
      input: { types: ["DownstreamOf"], direction: INCOMING, count: 50 }
    ) {
      relationships {
        entity {
          urn
          ... on Dataset {
            name
            platform { name }
            properties { description }
          }
        }
      }
    }
  }
}
"""

# Result: all dashboards, models, and exports that depend on fct_orders
# Use this BEFORE making schema changes

Column-Level Lineage

Source Tables                  Transformation              Target Table
─────────────                 ──────────────              ────────────
raw_payments.amount    ──→    SUM(amount)           ──→  fct_revenue.total_revenue
raw_payments.currency  ──→    exchange_rate_convert  ──→  fct_revenue.total_revenue_usd
raw_orders.order_id    ──→    JOIN key              ──→  fct_revenue.order_id
raw_customers.name     ──→    COALESCE(name, email) ──→  fct_revenue.customer_name

Column-level lineage answers:
  "Where does fct_revenue.total_revenue_usd come from?"
  → raw_payments.amount + raw_payments.currency via exchange_rate_convert

Anti-Patterns

  1. Manual lineage documentation — manually maintained lineage diagrams go stale immediately; automate via OpenLineage
  2. Table-level only — table lineage is not enough; column-level lineage is required for meaningful impact analysis
  3. No integration with incidents — lineage is most valuable during incidents; link quality alerts to lineage graph
  4. Lineage without ownership — every dataset in the catalog must have an owner team for accountability
  5. Collecting without using — lineage data is useless if nobody queries it; embed impact analysis in CI and change management

Quality Checklist

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.