Skip to main content

OpenLineage

This section explains how to send lineage to DataDios from any tool that speaks OpenLineage — for example Apache Airflow, Apache Spark and dbt. Instead of DataDios reading the tool, the tool pushes a small JSON "run event" to DataDios each time a job finishes. The event names the job, the tables it read and the tables it wrote.

DataDios turns each finished run into a job in the lineage graph, with an edge from every table the job read and to every table it wrote. When the tool also reports which input column fed which output column, those column edges are drawn too. Nothing changes in the lineage screens: the edges show up there like any other. The jobs are also listed on the data source's Metadata tab, and every run, finished or not, is recorded for the run history.


What it does​

  • Only finished runs write lineage. A run event with the state COMPLETE is used. START, FAIL and ABORT events write no edges and no job; they are only recorded as runs. RUNNING events are ignored.
  • A newer finished run of the same job replaces that job's edges. If a job stops writing a table, the old edge is gone after its next finished run.
  • Unmapped tables are skipped, never guessed. A table whose namespace is not in the map below is left out, and the response says how many were skipped. The job and the edges between the tables that did map are still written. If no table maps at all, nothing is kept.
  • Limits. One event can be up to 2 MiB. A job keeps up to 200 input tables and 200 output tables; the rest are skipped. One data source keeps up to 10,000 jobs; past that, new jobs are refused (429) until old ones expire.
  • Column edges. A column pair is drawn only when both of its tables are mapped and DataDios already holds both columns. A job keeps up to 2,000 column pairs; the rest are counted as skipped. See Column lineage.
  • A job that stops running is removed after job_retention_days (90 by default), together with its edges. See How long jobs are kept.
  • A job that is deleted in the tool keeps its last edges until job_retention_days has passed since its last run.

Not covered: run duration (it is not shown yet), a screen listing the skipped tables, and sending OpenLineage out of DataDios.


Before you start​

  1. Register the data sources your jobs read and write (Postgres, Snowflake, S3 and so on) in DataDios. Lineage can only join tables DataDios knows.
  2. Create a service account and an API key for it, to paste into the tool. A service account is a DataDios account for a program, not a person, and it can be used by a long-running job. A normal login token lasts 48 hours.
  3. Give that service account access to the OpenLineage data source you create below. The same permission check as every other data source decides; an account without access is refused.
API keys need IAM fully on

DataDios accepts a service-account API key only when IAM is fully on for your workspace. While it is not, the key is refused and the only way to send is a normal login token, which lasts 48 hours and is not usable for a long-running job. Ask your DataDios administrator to confirm IAM is on before you set up the tools.

Whose data the key acts on. A service-account key (ddk_) that sends no owner_id acts on its owner's data: OpenLineage push, adding a data source to a lineage graph, and the owner's workflows. Its role is still enforced; naming another user still needs a share. This applies only when your workspace's IAM mode is on; in shadow or off the key acts as itself.


Steps to Create an OpenLineage Data Source​

  1. Navigate to the Sources page and click + Add connection
  2. Select OpenLineage as the Type
  3. Enter a name. It goes into the address you paste into your tools, so pick one without spaces, for example prod-airflow-ol
  4. Fill in the namespace map (below)
  5. Click Test Connection. It only checks the namespace map; nothing is sent to your tools
  6. Click Create to save the data source

Create data source dialog with the OpenLineage type

The Endpoint address field shows the address of this data source. Paste it up to and including the trailing slash, for example https://<host>/openlineage/<data source name>/; the tool adds api/v1/lineage itself (see The settings to paste).

To change the map later, edit the data source:

Edit data source dialog for an OpenLineage data source

The namespace map​

A tool names every table by a namespace (the system it lives in) and a name. For a database the namespace is usually postgres://host:port, plus the database in some tools. DataDios cannot tell which of your data sources that refers to, so you say so with one setting, Namespace to DS: a map from namespace to data source. Click Add entry for each row and fill Namespace in the events and DataDios source. The map cannot be empty.

Namespace in the eventsDataDios source
postgres://pg-analytics:5432analytics-pg
oracle://hr-db:1521hr-oracle
PartMeaning
Namespace in the eventsThe namespace exactly as the tool sends it
DataDios sourceThe name of a DataDios data source you can see
  • Matching is exact. postgres://db1:5432/sales does not match postgres://db1:5432. A wrong match would draw a false edge, which is worse than a missing one, so DataDios skips what it cannot match.
  • The mapped data sources must already be registered and synced in DataDios.
  • To see the namespace a tool really sends, look at one of its events (the tool's log, or a console transport) and copy the namespace of an input or output dataset.
  • Edit the map after you see tables being skipped; the next finished run uses the new map.

How long jobs are kept​

DataDios keeps one entry per job, not one per run, so the list grows with the number of different jobs. A job that has not been seen for a while is removed. The setting is job_retention_days, an optional field of the data source.

SettingValue
job_retention_daysA whole number of days from 1 to 3650. Empty means 90. Any other value is refused when you click Test Connection or Create
  • A job is not seen when its newest finished run is older than job_retention_days. A job that keeps running is never removed, however old its first run is.
  • The removal happens at the next lineage graph rebuild, not at the moment the days pass. It removes the job from the data source's Metadata list and its edges (table and column) from the graph.
  • It removes only the job. The tables it read and wrote belong to their own data sources and are not touched.
  • If the job runs again later, it is added back by its next finished run.

The settings to paste​

Every OpenLineage tool has the same HTTP transport with the same three values. The tool adds api/v1/lineage to the url by itself, so you do not set an endpoint.

SettingValue
urlhttps://<host>/openlineage/<data source name>/ — it must end with a slash, or the tool drops the data source name from the address and gets 404
auth.typeapi_key
auth.apiKeyA service-account API key. The tool sends it as Authorization: Bearer <key>

For example https://app.example.com/openlineage/prod-airflow-ol/. The tool then posts to https://app.example.com/openlineage/prod-airflow-ol/api/v1/lineage.

Use the placeholders <DATADIOS_URL> (the whole url above, with the slash) and <API_KEY> below. Keep the key in the tool's own secret store, not in a file you commit.

Airflow​

Uses the OpenLineage provider (apache-airflow-providers-openlineage). Set the transport in airflow.cfg under [openlineage], or as the environment variable:

AIRFLOW__OPENLINEAGE__TRANSPORT='{
"type": "http",
"url": "<DATADIOS_URL>",
"auth": {"type": "api_key", "apiKey": "<API_KEY>"}
}'

Restart the scheduler and workers after you change it. Tasks that use SQL operators and the other operators the provider supports send their tables; other tasks send the job with no tables.

Spark​

Uses the openlineage-spark listener. Add it and the transport to the job's Spark configuration:

spark.jars.packages                          io.openlineage:openlineage-spark_2.12:<version>
spark.extraListeners io.openlineage.spark.agent.OpenLineageSparkListener
spark.openlineage.transport.type http
spark.openlineage.transport.url <DATADIOS_URL>
spark.openlineage.transport.auth.type api_key
spark.openlineage.transport.auth.apiKey <API_KEY>

Pick the openlineage-spark artifact that matches your Scala version (_2.12 or _2.13). A Spark job sends many events; only the finished ones write lineage.

dbt​

Uses openlineage-dbt. Run dbt through its wrapper dbt-ol instead of dbt, with an openlineage.yml in the project directory (or the path in OPENLINEAGE_CONFIG):

transport:
type: http
url: <DATADIOS_URL>
auth:
type: api_key
apiKey: <API_KEY>
dbt-ol run

Other tools​

Flink, Dagster, Trino and custom pipelines work the same way: use the tool's OpenLineage HTTP transport with the three values above.


Column lineage​

If the tool reports column lineage (the OpenLineage columnLineage facet on an output table), DataDios draws one edge from each source column to the output column it feeds. The edges are in the same lineage graph, below the table edge of the same job.

  • Both columns must already be in DataDios. The graph holds the columns of a table once its data source has been synced. A pair whose column is not in the graph is not drawn and is counted as skipped; so is a pair whose table is not in the namespace map, or that names a table the job does not list.
  • Column names are matched without regard to upper or lower case.
  • The response to the tool shows columns_skipped, the number of pairs left out. If it is more than you expect, sync the data source that holds the table, and send the job again.
  • A newer finished run of the job replaces that job's column edges, the same as its table edges. Fixing the namespace map or syncing a source heals skipped pairs at the next graph rebuild.
  • Tools that send no columnLineage facet (for example many Airflow operators) give table edges only.

The Metadata tab​

Open the OpenLineage data source and go to its Metadata tab. It lists the jobs kept for this data source, grouped by the install that sent them (the job namespace, for example airflow-prod). Choose a job to see its detail, which has three parts:

PartWhat it shows
AttributesJob, Namespace, Owner (from the tool's ownership facet, or "none given"), Tables read, Tables written. When the per-job table limit cut some tables, Tables not shown says how many
DefinitionThe job's SQL, when the tool sends its sql facet. It is cut at 5,000 characters, with a marker. Empty when the tool sends none
DatasetsOne row per table the job read or wrote: DIRECTION (Reads or Writes), TABLE, DATADIOS SOURCE and ADDRESS IN EVENT
  • In Datasets, DATADIOS SOURCE is the data source the namespace map points to, or not mapped. A row that says not mapped is the quickest way to find the namespace to add to the map.
  • The detail comes from the job's newest finished run. A job that is no longer kept (see How long jobs are kept) shows "The job is no longer kept by this source".

Run history​

Besides the lineage, DataDios records every START, COMPLETE, FAIL and ABORT event it accepts as a run record. The tool gets a normal 200 answer for all four; only COMPLETE also writes the job and its edges. RUNNING events are not recorded, because some tools (Spark) send many.

The records are collected hourly into the DD Pipeline Runs metric group of the workspace's own datadios_self data source, which only administrators can read. Each row is one hour, one job and one status, not one run, so 1,000 runs of a job in an hour make one row.

Shown for each hourMeaning
Data source, job (<namespace>:<name>)Which OpenLineage data source and job
StatusSTART, COMPLETE, FAIL or ABORT
EventsHow many events of that status arrived. A tool that sends the same event again is counted again
Rows writtenRows the run reports as written (outputStatistics), added up for the hour; empty when the tool reports none
Lateness (sec)How long after its due time (nominalTime) the run's event came; empty when the tool sends no due time
Error classFor FAIL only: timeout, auth, connection or unknown. The error message itself is never stored
Schema hashA fingerprint of the output columns, to spot a changed schema
  • Run duration is not shown yet. It comes in a later release, together with the Pipeline runs dashboard tab and alerts. Until then the group can be read in the Workload Analyzer's metric groups, with no ready-made tab.
  • Only the 1,000 busiest jobs of each hour are kept as their own rows; the rest are added into one row with the job empty.
  • Run records are kept for 60 days.

Check that it works​

  1. Run a job that reads one mapped table and writes another, and let it finish.
  2. In DataDios, open the lineage graph for the written table. The job appears between the two tables.

Lineage graph at source level

Lineage graph at table level, with the job between the tables

If it does not, use the table below.


Troubleshooting​

What you seeWhat to check
The tool logs 400A finished event is missing a field DataDios needs (job.namespace, job.name, run.runId, eventTime) or is not valid JSON
The tool logs 401The API key is wrong or expired, or IAM is not on so keys are refused — see Before you start
The tool logs 403The service account has no access to the OpenLineage data source
The tool logs 404The url is wrong (check the trailing slash), or the name in it is not an OpenLineage data source — see The settings to paste
The tool logs 413The event is larger than 2 MiB
The tool logs 429The data source is at its limit of 10,000 jobs
The tool logs 503Lineage is turned off for this workspace; ask your DataDios administrator
The tool reports success but no edge appearsThe run did not finish (COMPLETE), or its tables are not in the namespace map. The response shows skipped, how many tables were left out; compare the namespace in the event with the map
Table edges appear but no column edgesThe tool sends no columnLineage facet, or the response shows columns_skipped: a column is not in the graph yet (sync its data source) or its table is unmapped. See Column lineage
A job is gone from the Metadata tabIt was not seen for job_retention_days; its next finished run adds it back. See How long jobs are kept
job_retention_days must be a whole number of days, 1 to 3650Enter a whole number from 1 to 3650, or leave the field empty for 90
An old edge is still thereEdges are replaced only by the job's next finished run, and a job deleted in the tool keeps its last edges until job_retention_days has passed
Only some tables of a job appearThe rest are unmapped and were skipped; add their namespace to the map

See also​

  • Lineage — how to read the graph this source feeds
  • Apache Airflow — the other way to get Airflow lineage: DataDios reads Airflow's datasets through its REST API
  • Overview — the full list of connectors