Skip to main content

Dagster integration for OpenLineage

Project description

dagster-openlineage

Dagster integration for OpenLineage for automatic metadata collection. It provides an OpenLineage sensor that tails Dagster event logs, converts events to OpenLineage metadata, and emits them to a backend.

Features

  • Metadata tracking for Dagster jobs & ops lifecycle
  • OpenLineage sensor for automatic event collection

Requirements

  • Python 3.10+
  • Dagster >=1.6.9

Installation

pip install dagster-openlineage

Quick Start

Add the openlineage_sensor to your Dagster Definitions:

from dagster import Definitions, job, op
from dagster_openlineage import openlineage_sensor

@op
def extract():
    return {"data": 1}

@op
def transform(data):
    return data["data"] + 1

@job
def my_job():
    transform(extract())

defs = Definitions(
    jobs=[my_job],
    sensors=[openlineage_sensor()]
)

Usage

Sensor Configuration

The sensor supports several configuration options:

Option Default Description
minimum_interval_seconds 300 Minimum seconds between sensor evaluations
record_filter_limit 30 Max number of event logs to process per evaluation
after_storage_id 0 Starting storage ID for event processing

Custom configuration example:

defs = Definitions(
    jobs=[my_job],
    sensors=[
        openlineage_sensor(
            minimum_interval_seconds=60,
            record_filter_limit=60,
        )
    ]
)

Resuming from a specific storage ID:

Use after_storage_id to resume processing from a specific point in your event log. This is useful when you need to reprocess events or start from a known storage ID:

defs = Definitions(
    jobs=[my_job],
    sensors=[openlineage_sensor(after_storage_id=500)]
)

Configuration

Environment Variables

Set the following environment variables:

  • OPENLINEAGE_URL - URL of the OpenLineage backend (required)
  • OPENLINEAGE_API_KEY - Bearer token for authentication (optional)
  • OPENLINEAGE_NAMESPACE - Default namespace (optional)

Where to set these:

  • User Repository Deployments: Add variables to the repository where the sensor is defined
  • Otherwise: Add variables to the Dagster Daemon

Important Notes

  • Single sensor per instance: Only define one OpenLineage sensor per Dagster instance. Multiple sensors will emit duplicate job runs.

  • Non-sharded event log storage: Use non-sharded event log storage. Sharded storage (like default SqliteEventLogStorage) may prevent the cursor from updating properly.

Version Compatibility

This library supports Dagster versions >=1.6.9.

  • End users: pip install dagster-openlineage respects pyproject.toml constraints, allowing any compatible Dagster version
  • CI builds: Uses committed uv.lock for reproducible builds
  • Developers: Can test specific Dagster versions by updating the lock file

Development

Setup

# Install dependencies
uv sync

# Run tests
make test

Testing with Different Dagster Versions

# Install desired version
uv pip install dagster==1.XX

# Update lock file
uv lock --upgrade-package dagster==1.XX

# Run tests
make test

# Revert to default
uv lock
make test

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dagster_openlineage-0.1.0.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dagster_openlineage-0.1.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file dagster_openlineage-0.1.0.tar.gz.

File metadata

  • Download URL: dagster_openlineage-0.1.0.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for dagster_openlineage-0.1.0.tar.gz
Algorithm Hash digest
SHA256 935621d79d4496c4b3100244e2bfdb495cd60909c3880fcb5ee5bc516296cb87
MD5 c410ae1561428237a798bfd110d5027e
BLAKE2b-256 2813fe38c87c125072af7bc7347e39f5831738149f5265b9f6ca517c40c89334

See more details on using hashes here.

File details

Details for the file dagster_openlineage-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dagster_openlineage-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for dagster_openlineage-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1826ce5f891177bceed5a95ca91761fac14c8416fe0289ced495c4e0ed7b4014
MD5 0fd264c9385459905a64e33f61226666
BLAKE2b-256 393c66d7019356ad8aac3cd9427a622a12229cfb368130ad08abdd9f59969d1c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page