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-openlineagerespectspyproject.tomlconstraints, allowing any compatible Dagster version - CI builds: Uses committed
uv.lockfor 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
935621d79d4496c4b3100244e2bfdb495cd60909c3880fcb5ee5bc516296cb87
|
|
| MD5 |
c410ae1561428237a798bfd110d5027e
|
|
| BLAKE2b-256 |
2813fe38c87c125072af7bc7347e39f5831738149f5265b9f6ca517c40c89334
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1826ce5f891177bceed5a95ca91761fac14c8416fe0289ced495c4e0ed7b4014
|
|
| MD5 |
0fd264c9385459905a64e33f61226666
|
|
| BLAKE2b-256 |
393c66d7019356ad8aac3cd9427a622a12229cfb368130ad08abdd9f59969d1c
|