Skip to main content

Airflow plugin to export dag and task based metrics to Prometheus.

Project description

Airflow prometheus exporter

Exposes dag and task based metrics from Airflow to a Prometheus compatible endpoint.

Compatibility with Airflow versions

3.*

Versions >=2.0.0 will support only Airflow 3.0+

2.*

Versions >=1.7.0,<2 are compatible with Airflow 2.*

Development of Airflow 2 compatible version happens from airflow-2 branch

Install

pip install airflow-exporter

That's it. You're done.

Exporting extra labels to Prometheus

It is possible to add extra labels to DAG-related metrics by providing labels dict to DAG params.

Example

dag = DAG(
    'dummy_dag',
    schedule_interval=timedelta(hours=5),
    default_args=default_args,
    catchup=False,
    params={
        'labels': {
            'env': 'test'
        }
    }
)

Label env with value test will be added to all metrics related to dummy_dag:

airflow_dag_status{dag_id="dummy_dag",env="test",owner="owner",status="running"} 12.0

Metrics

Metrics will be available at

http://<your_airflow_host_and_port>/admin/metrics/

airflow_task_status

Labels:

  • dag_id
  • task_id
  • owner
  • status

Value: number of tasks in a specific status.

airflow_dag_status

Labels:

  • dag_id
  • owner
  • status
  • paused

Value: number of dags in a specific status.

airflow_dag_run_duration

Labels:

  • dag_id: unique identifier for a given DAG

Value: duration in seconds of the longest DAG Run for given DAG. This metric is not available for DAGs that have already finished.

airflow_dag_last_status

Labels:

  • dag_id
  • owner
  • status
  • paused

Value: 0 or 1 depending on wherever the current state of each dag_id is status.

License

Distributed under the MIT license. See LICENSE for more information.

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

airflow_exporter-2.0.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

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

airflow_exporter-2.0.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file airflow_exporter-2.0.0.tar.gz.

File metadata

  • Download URL: airflow_exporter-2.0.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for airflow_exporter-2.0.0.tar.gz
Algorithm Hash digest
SHA256 4ef76f3ae3ccd45a601e0de63fdd14bbc46eda5638abd4297fc7c4d82fcdf716
MD5 f86420f8aa8433f2e48c8d9d598d9423
BLAKE2b-256 9d377a92a3735b1cfda37fda5f3e657c76fac98e6238495353a95c8c3e3db323

See more details on using hashes here.

Provenance

The following attestation bundles were made for airflow_exporter-2.0.0.tar.gz:

Publisher: publish.yml on epoch8/airflow-exporter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file airflow_exporter-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for airflow_exporter-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f50fcea5f56b75d5018ba5f061219bca84fb0911b2554eb500bdc7b32f18fc66
MD5 3e75c996915621bc803b5696af3a7a3c
BLAKE2b-256 3367af6d977de77279639962c8ceb4d13d4b1fa00bad085e5dea3be3a8cb9e6f

See more details on using hashes here.

Provenance

The following attestation bundles were made for airflow_exporter-2.0.0-py3-none-any.whl:

Publisher: publish.yml on epoch8/airflow-exporter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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