Apache Airflow provider for Telomere lifecycle tracking
Project description
Telomere Airflow Provider
Apache Airflow provider for Telomere lifecycle tracking. It monitors whole DAG runs and individual critical tasks, with server-side timeouts as a fallback when Airflow cannot report.
Requires Apache Airflow >= 3.0, < 4 and Python >= 3.10. Airflow 2 users should
pin telomere-airflow-provider==0.0.1.
Installation
pip install telomere-airflow-provider
Add a connection named telomere_default with connection type Telomere and
your API key in the password field:
airflow connections add telomere_default \
--conn-type telomere \
--conn-password YOUR_API_KEY
Or configure it through the environment:
export AIRFLOW_CONN_TELOMERE_DEFAULT='telomere://:YOUR_API_KEY@'
DAG-run tracking
Opt a DAG in with the telomere tag:
from airflow.sdk import DAG
dag = DAG(
"daily_report",
schedule="0 2 * * *",
tags=["telomere"],
)
Existing callers can keep the one-line helper. In 2.0 it only adds the tag and does not modify the task graph:
from telomere_provider.utils import enable_telomere_tracking
enable_telomere_tracking(dag)
The provider's Airflow plugin listens for scheduler-computed DAG-run state changes:
on_dag_run_runningcreates<dag_id>.dagand starts a Telomere run.on_dag_run_successresolves the matching run as completed.on_dag_run_failedresolves it as failed, including scheduler timeouts and all-tasks-deadlocked outcomes.
Runs carry dag_id, Airflow run_id, run_type, and (when present)
logical_date tags, plus a link to the Airflow run. Terminal events find the
running Telomere run by its Airflow run_id, so tracking remains correct after
scheduler restarts and when a run is marked manually through the API server.
The run timeout is selected in this order:
- the DAG's
dagrun_timeout; - the data-interval length;
- one hour.
Every schedulable DAG also maintains <dag_id>.schedule. Its deadline uses
Airflow's next_dagrun_create_after plus five minutes of grace, falling back
to the current data-interval end. This is the deadman switch for a scheduler
or DAG that stops creating runs entirely.
Listener errors are isolated by Airflow and cannot change a DAG run's state. A write outage can therefore leave a Telomere run open until its timeout, but it cannot fail the user's workflow.
Upgrading to 2.0
enable_telomere_tracking no longer accepts lifecycle_name,
timeout_seconds, tags, telomere_conn_id, fail_on_telomere_error,
track_schedule, or other options. Stale calls raise TypeError during DAG
parsing instead of silently changing behavior.
Use dagrun_timeout for a per-DAG execution timeout. DAG lifecycle names are
now always <dag_id>.dag, schedule monitoring is automatic for schedulable
DAGs, and the listener always uses telomere_default. The removed
TelomereDAGStartOperator, TelomereCanaryOperator, and
TelomereFinalizeOperator are no longer needed because no tasks are injected.
Task-level tracking
TelomereLifecycleOperator remains available for critical operations that
need their own lifecycle, custom timeout, tags, or connection:
from telomere_provider.operators.telomere import TelomereLifecycleOperator
critical_task = TelomereLifecycleOperator(
task_id="process_payment",
python_callable=process_payment_batch,
lifecycle_name="payment_processing",
timeout_seconds=300,
tags={"priority": "high"},
dag=dag,
)
Relative lifecycle names are namespaced by the DAG ID. For example,
lifecycle_name="validate" becomes <dag_id>.validate. The value may also be
a callable that receives the Airflow task context.
By default, Telomere errors do not fail the task. Set
fail_on_telomere_error=True when inability to record the task should fail
the Airflow task itself.
Connection options
The connection extra JSON supports read retry and timeout settings:
{
"timeout": 30,
"max_retries": 3,
"backoff_factor": 0.3
}
Retries apply to reads only. Writes are not replayed because retrying a run start after an ambiguous response could create a duplicate.
Development
uv sync
uv run ruff check .
uv run pytest
The test suite has three tiers:
- unit tests for the hook, listener, tag shim, and task operator;
- an Airflow-version matrix that drives terminal DAG shapes through
dag.test()and the real listener plugin; - end-to-end tests using a real scheduler and Telomere API.
Run the end-to-end tier with:
TELOMERE_API_KEY=... tests/e2e/run.sh
The Docker Compose stack exposes Airflow at http://localhost:8080 with
username and password airflow. See docker/README.md.
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 telomere_airflow_provider-2.0.0.tar.gz.
File metadata
- Download URL: telomere_airflow_provider-2.0.0.tar.gz
- Upload date:
- Size: 24.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4cee4d99fe64650ef1737b2d8e73fc33ab86dbd86049f0da1ba4b3d140ebdc69
|
|
| MD5 |
7462cc69fa448089e801d940b69a6c12
|
|
| BLAKE2b-256 |
981c6b8a0f8e4f3a2253328baa88fcb70d3a9c81dd8a4a40eef1112373034818
|
Provenance
The following attestation bundles were made for telomere_airflow_provider-2.0.0.tar.gz:
Publisher:
publish.yml on modulecollective/telomere-airflow-provider
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
telomere_airflow_provider-2.0.0.tar.gz -
Subject digest:
4cee4d99fe64650ef1737b2d8e73fc33ab86dbd86049f0da1ba4b3d140ebdc69 - Sigstore transparency entry: 2187378270
- Sigstore integration time:
-
Permalink:
modulecollective/telomere-airflow-provider@199deea6e16fb265100910755782cbbfa35420f5 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/modulecollective
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@199deea6e16fb265100910755782cbbfa35420f5 -
Trigger Event:
release
-
Statement type:
File details
Details for the file telomere_airflow_provider-2.0.0-py3-none-any.whl.
File metadata
- Download URL: telomere_airflow_provider-2.0.0-py3-none-any.whl
- Upload date:
- Size: 20.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be6fe741f8a23804cf92171771729b285c96f03b72d6176302630150c4f18e41
|
|
| MD5 |
078e23dd2e24a27b5831279458358a0a
|
|
| BLAKE2b-256 |
28533ea5c6b28eea453e31d693a07969fd925e1e6559231d63fda83aeaa5ba2c
|
Provenance
The following attestation bundles were made for telomere_airflow_provider-2.0.0-py3-none-any.whl:
Publisher:
publish.yml on modulecollective/telomere-airflow-provider
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
telomere_airflow_provider-2.0.0-py3-none-any.whl -
Subject digest:
be6fe741f8a23804cf92171771729b285c96f03b72d6176302630150c4f18e41 - Sigstore transparency entry: 2187378285
- Sigstore integration time:
-
Permalink:
modulecollective/telomere-airflow-provider@199deea6e16fb265100910755782cbbfa35420f5 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/modulecollective
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@199deea6e16fb265100910755782cbbfa35420f5 -
Trigger Event:
release
-
Statement type: