OpenLineage Documentation

repository·main·Indexed 25 days ago

https://github.com/openlineage/openlineage

An open standard for collecting metadata and data lineage by instrumenting jobs during execution. It provides a unified model of jobs, runs, and datasets to enable consistent observability across diverse data tools. The documentation covers the Go SDK for managing run lifecycles and event emission, as well as Java transport dependencies for Amazon DataZone, GCP Lineage (Dataplex), and Google Cloud Storage.

Tokens
232.5K
Snippets
394
Records
924
Agent score
81%

What's inside OpenLineage

  1. Overview of OpenLineage Flink integration

    main
    The OpenLineage Flink integration enables the emission of OpenLineage metadata from Apache Flink applications. It achieves this by using JVM instrumentation to capture lineage information during runtime. For detailed configuration and setup instructions, refer to the official OpenLineage documentation.
  2. Overview of OpenLineage Java SDK core components

    main

    The OpenLineage Java SDK is used to generate and emit OpenLineage events to backends. The SDK provides several core data structures and mechanisms:

    Core Data Structures

    • RunEvent: Represents an event in a lineage run.
    • RunState: Represents the state of a run.
    • Run: Represents a specific execution.
    • Job: Represents the logical unit of work.
    • Dataset: Represents the data entities involved.
    • Facets: Various metadata components that can be attached to Run, Job, or Dataset objects.

    Transport Mechanism

    • Transport: An abstraction used to carry lineage events to target endpoints (e.g., via HTTP). The library provides various built-in transports.
  3. New use cases supported by Static Lineage in OpenLineage 1.0

    main

    With the introduction of static lineage in version 1.0, the following use cases are now supported:

    • Bootstrapping lineage graphs: Using prospective runs for auditing purposes.
    • Dataset ownership: Capturing changes to dataset ownership that occur outside of standard job runs.
    • External facets: Consuming facets from external systems.
    • Dataset symlinks: Creating dataset symlinks more easily.
  4. Understand the OpenLineage Test Suite Workflows

    main

    The OpenLineage test suite utilizes three distinct workflows to ensure compatibility across different scenarios. These workflows automate component testing, report generation, and failure detection. Depending on the trigger, the scope of tested components and the version of the OpenLineage specification used will vary:

    1. New Release Workflow

    Goal: Update compatibility data. Trigger: Periodic runs that check for new releases of OpenLineage or its components. Scope: Tests both Producers and Consumers. Component Selection: Only components with new releases are tested, or all components if a new OpenLineage release is detected. OpenLineage Versions: Uses official Release Versions. Additional Actions: Notifies about new failures, updates test reports, and updates compatibility information.

    2. Spec Update Workflow

    Goal: Notify developers of potential backward compatibility issues when the specification changes. Trigger: Periodic runs that check for updates to the specification in the OpenLineage main branch. Scope: Tests Producers and Consumer Input Events. Component Selection: All Producers and Consumer Input Events are tested. OpenLineage Versions: Uses the Latest snapshot version from the main branch. Additional Actions: Notifies about new failures.

    3. Test Suite PR Workflow

    Goal: Ensure that changes made to the test suite itself do not introduce new failures. Trigger: A Pull Request (PR) submitted to the Test Suite repository. Scope: Tests Producers, Consumers, and Consumer Input Events. Component Selection: All Producers, Consumers, and Consumer Input Events are tested. OpenLineage Versions: Uses official Release Versions.

  5. Understand OpenLineage Compatibility Tests

    main

    The OpenLineage Compatibility Tests are a suite of automated checks designed to validate how different versions of OpenLineage interact with various producers (components that emit events) and consumers (components that ingest events).

    These tests are hosted in a dedicated GitHub repository and use GitHub Actions to continuously verify compatibility. The results are used to generate compatibility tables in the official documentation.

    Validation Types:

    • For Producers: Validates that generated OpenLineage events comply with the expected structure (syntax) and that the values in the event fields are correct (semantics).
    • For Consumers: Validates that valid OpenLineage events can be ingested without error (syntax) and that they result in the correct changes to the consumer's internal state (semantics).
  6. Available local OpenLineage integration packages

    main

    The following integration packages are maintained locally within this repository:

    • dbt: Integration for dbt projects.
    • Apache Spark: Integration for Spark workloads.
    • Apache Flink: Integration for Flink workloads.

    Note: The Apache Airflow integration is maintained in the official Apache Airflow repository rather than locally here.

  7. Use OpenLineage clients and integrations

    main

    OpenLineage can be implemented by using official clients to send events to an HTTP backend or by using existing integrations that automatically collect metadata as OpenLineage events.

    Clients

    If you are building custom tools, you can use the following clients to emit OpenLineage events via HTTP:

    • Java Client
    • Python Client

    Integrations

    Metadata can be collected automatically from common data tools using these integrations:

    • Apache Airflow: Supports BigQuery, Great Expectations, Postgres, Redshift, and Snowflake.
    • Apache Spark
    • dbt
  8. Use the OpenLineage Spark Listener

    main

    The OpenLineage Spark Agent uses JVM instrumentation to automatically emit OpenLineage metadata from Spark applications. This allows you to capture lineage information without manually instrumenting your Spark code.

    For detailed setup, refer to the official documentation links:

    • Installation: How to add the agent to your Spark environment.
    • Configuration: How to tune the agent's behavior.
    • Quickstart: A guide for running a local Spark job with OpenLineage.
    • Column-Level Lineage: How to enable and use fine-grained lineage tracking.
    • Extending: How to build custom extensions for the Spark agent.
  9. Core modules of the OpenLineage Python Client

    main

    The OpenLineage Python client is organized into several functional modules for interacting with the OpenLineage specification:

    • openlineage.client.client: The primary entry point for client operations.
    • openlineage.client.event_v2: Handles OpenLineage event models (v2).
    • openlineage.client.facet & openlineage.client.facet_v2: Modules for managing facets (metadata extensions).
    • openlineage.client.run: Provides abstractions for representing job runs.
    • openlineage.client.serde: Handles serialization and deserialization of OpenLineage data.
    • openlineage.client.transport: Contains various transport implementations for sending metadata (e.g., HTTP, Kafka, File, Console).
  10. Configure the OpenLineage Python client

    main

    The OpenLineage Python client can be configured using four main sections:

    1. Transports: Defines how events are sent (e.g., HTTP, Kafka, File, Console).
    2. Facets: Configures metadata facets, such as attaching environment variables to events.
    3. Filters: Defines rules to selectively exclude specific events.
    4. Tags: Configures custom tags added to jobs and runs as custom facets.

    Configuration Methods and Precedence

    Configuration is read only at client creation time. The precedence (from highest to lowest) is:

    1. Python Code: Passed directly to the OpenLineageClient constructor via the config parameter.
    2. YAML Configuration File: An openlineage.yml file.
    3. Environment Variables: Variables with the OPENLINEAGE__ prefix.
    4. Legacy Environment Variables: Specific variables for HTTP transport (e.g., OPENLINEAGE_URL).

    If no configuration is provided, the client defaults to ConsoleTransport, printing events to the console.