View a markdown version of this page

How lineage capture works - AWS Glue

How lineage capture works

AWS Glue Data Catalog Lineage has three stages: capture, processing, and consumption.

Capture

Lineage reaches AWS Glue Data Catalog in one of the following ways:

  • AWS services. On supported releases, the service's control plane registers the OpenLineage Spark listener with the AWS Glue transport when a cluster, application, or job starts. When a Spark action writes data, the listener builds an OpenLineage event and calls PostLineageEvent with the credentials of the job's role. For details, see Automatic lineage capture from AWS services.

  • Data Catalog changes. When a table is created in the Data Catalog, AWS Glue records lineage from the table's Amazon S3 location to the table. For details, see Lineage for AWS Glue Data Catalog tables and crawlers.

  • Third-party and open-source producers. OpenLineage producers send events through the AWS Glue OpenLineage transport, or AWS Glue crawlers collect lineage from Snowflake and Databricks Unity Catalog.

  • Your own code. Any application can call PostLineageEvent.

Capture is designed not to affect your workloads. If the job role lacks permission, or AWS Glue can't be reached, the job continues to run normally and doesn't send lineage. The Spark driver log shows a warning.

Processing

AWS Glue validates each event, stores it, and returns an event ID. It then processes the event asynchronously:

  1. It resolves each dataset to a dataset node. A table in the Data Catalog resolves to its table ARN however the job refers to it (orders, sales_db.orders, or awsdatacatalog.sales_db.orders).

  2. It creates or updates the job node and adds edges from the input datasets to the job, and from the job to the output datasets.

  3. It records column lineage on the output dataset nodes.

When a job runs again, AWS Glue updates the job's edges to the latest run, so the graph shows the current state of your pipelines.

Retention

  • Lineage graph. AWS Glue keeps the relationships between jobs and datasets indefinitely.

  • Raw lineage events. AWS Glue keeps raw events for a limited time period. To keep the full event history longer, turn on the lineage system table.

Consumption

  • Visualization. View the graph in the AWS Glue console.

  • APIs. Call GetLineageNode to read a node and its upstream and downstream neighbors.

  • SQL. When the lineage system table is on, AWS Glue writes each event to aws-catalog.lineage.events in your account, typically within about 5 minutes.

  • AWS Context. When you connect AWS Context, AWS Glue publishes the lineage graph so agents can use it.

Scope of a lineage graph

Each AWS account has one lineage graph in each AWS Region. Lineage events stay in the Region where the job runs.

Best-effort delivery

Lineage is best effort. AWS Glue doesn't guarantee that every job run produces a lineage event, for example when a role lacks permission or a request is throttled. Don't use lineage as a compliance audit log. For access auditing, use AWS CloudTrail and AWS Lake Formation audit logs.