Publish runs to lineage
Description
The Publish runs to lineage action publishes the runs an Execution Information Location recorded to a Lineage Sink: an OpenLineage collector such as Marquez, or DataHub.
Each run is published as it ran, with:
-
when it started and ended, and whether it succeeded or failed;
-
its transforms or actions, each with how it ended, and the row counts of the transforms;
-
the pipelines and workflows it started, linked to the action or transform that started them;
-
the tables and files its transforms declare they read and write, as the Publish lineage action publishes them.
Use it for runs that had no lineage sink while they ran, for example on a server where lineage is not set up, or to give a sink that was added later the runs of the past days. Put it at the end of a nightly workflow, or schedule it, to publish the runs of each day.
A run keeps the id it ran with, and its events the times it ran at. Publishing a run again, or a run that was already reported while it ran, describes the same run in the catalog, not a second one.
The same is available on the command line as hop lineage-publish-runs:
hop lineage-publish-runs -j my-project -e prod -l audit -s marquez
hop lineage-publish-runs -j my-project -l audit -s marquez -p ONE_WEEK -n load-
Options
| Option | Description |
|---|---|
Action name |
The name of the action. |
Execution information location |
The Execution Information Location the runs were recorded in: the one the run configurations of those runs name. |
Lineage sink |
The Lineage Sink to publish to. |
Runs ended in the last |
Only the runs that ended in this last period are published, with the runs they started. A run that started before the period and ended in it is published, so a nightly publication of the last day misses no run. |
Name contains |
Only the pipelines and workflows whose name contains this text, ignoring case, each with the runs it started, whatever their names. A matching run started by a run that doesn’t match, such as pipeline |
On the command line, -l (--location) names the location, -s (--sink) the lineage sink, -p (--period) the period (ONE_HOUR, ONE_DAY, ONE_WEEK, …, or NONE for every run; the default is ONE_DAY) and -n (--name) the text the names contain; -j and -e select the project and environment.
Result
The action succeeds when every run was read and the sink delivered all of it. It fails when a run can’t be read (the others are still published), or the sink refused or didn’t receive part of it; the log says which. A run that has not ended yet is left out and counted in the log; the first publication after it ended picks it up. A run that never got an end, because Hop stopped while it ran, is never published; it is counted while it started or was updated within the period.
Notes
-
What a transform read and wrote is what it declares, resolved with the variables of the workflow and the default values of the pipeline’s parameters: an execution information location does not keep the values the parameters had in a run. A file name or table name that comes from a parameter value, a field or a variable set while the run ran is published as the default resolves it, or not at all.
-
Row counts come from the metrics the location kept. A transform whose metrics were not kept has no counts.
-
The location records the pipelines and workflows that ran with a run configuration that names it. A run the location did not record, such as a mapping, is not published.
-
A run started by a run the location did not record, such as a pipeline run with the location by a workflow run without it, is published on its own, without the run that started it.
-
Publishing asks no database for anything.