Airflow plugin for automatically sending metrics from Airflow to Datadog
Project description
airflow-metrics
airflow-metrics
is an Airflow plugin for automatically sending metrics from Airflow to Datadog.
Installation
pip install airflow-metrics
Setup
airflow-metrics
will report all metrics to Datadog, so create an airflow
connection with your Datadog api key.
airflow connections --add --conn_id datadog_default --conn_type HTTP --conn_extr '{"api_key": "<your api key>"}'
Note: If you skip this step, your airflow
installation should still work but no metrics will be reported.
Usage
That's it! airflow-metrics
will now begin sending metrics from Airflow to Datadog automatically.
Configuration
By default, airflow-metrics
will begin extracting metrics from Airflow as you run your DAGs and send them to overflow. You can opt out of it entirely or opt out of a subset of the metrics by setting these configurations in your airflow.cfg
[airflow_metrics]
airflow_metrics_enabled = True
airflow_metrics_tasks_enabled = True
airflow_metrics_bq_enabled = True
airflow_metrics_gcs_to_bq_enabled = True
airflow_metrics_requests_enabled = True
airflow_metrics_thread_enabled = True`
Limitations
airflow-metrics
starts a thread to report some metrics, and is not supported when using sqlite as your database.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Getting Started
Set up your virtual environment for python3 however you like.
pip install -e .
airflow initdb
airflow connections --add --conn_id datadog_default --conn_type HTTP --conn_extr '{"api_key": ""}'
Note: The last step is necessary, otherwise the plugin will not initialize correctly and will not collect metrics. But you are free to add a dummy key for development purposes.
Running Tests
pip install -r requirements-dev.txt
pytest
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
Built Distribution
File details
Details for the file airflow-metrics-0.1.0.tar.gz
.
File metadata
- Download URL: airflow-metrics-0.1.0.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31a87c91cc52ffa26faf3c0fa50ae79db283f3a90aa76c7fe69d22d8c603dad3 |
|
MD5 | 13a934085b1009cc4b880579ccc3e90f |
|
BLAKE2b-256 | eb4a5de51b5c70a711e56d83d749be7f63eaabe189e4258cb0dc1e48667c2c58 |
File details
Details for the file airflow_metrics-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: airflow_metrics-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e99f9b89a5f30f5ee9956ddd2d60dc1d03d11c3ab81200b3e84880b3c86f380 |
|
MD5 | f3573c8443e9c3404e4783d143a577db |
|
BLAKE2b-256 | 26f4532c7743add20f6eeba540d6db16c5f6e45fd8e7f344463651194f72e3a3 |