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
>=2.0
Current version is compatible with Airflow 2.0+
<=1.10.14, >=1.10.3
Version v1.3.2 is compatible
Note: Airflow 1.10.14 with Python 3.8 users
You should install importlib-metadata
package in order for plugin to be loaded. See #85 for details.
<1.10.3
Version v0.5.4 is compatible
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
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
Value: 0 or 1 depending on wherever the current state of each dag_id
is status
.
License
Distributed under the BSD license. See LICENSE for more information.
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
File details
Details for the file airflow-exporter-1.5.3.tar.gz
.
File metadata
- Download URL: airflow-exporter-1.5.3.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47c93a019e306b8203daea3d12ea114c98c3a24c02089dd61af36206538dafb2 |
|
MD5 | 0c50dd4440524e5e0bc0fbc0ed2ee63e |
|
BLAKE2b-256 | 446cfc669b2438d82d2d729bb27b21012f4ca30f27377193dea614f8c4b95d25 |
File details
Details for the file airflow_exporter-1.5.3-py2.py3-none-any.whl
.
File metadata
- Download URL: airflow_exporter-1.5.3-py2.py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1308e097da8de327ee46eb6517f8eb95d6711dffcdaf7d37bb1cd4685fe74ba |
|
MD5 | d77a2d8c99f0e6b73e62cd3824d6091b |
|
BLAKE2b-256 | f742aa060f05f15ac9b32a580bbf3a70e652bdb5f00696c9e3935ef0071b8fe5 |