View task usage metrics on Astronomer Software
Task usage metrics provide an overview of your Airflow task runs and can help you quickly identify Deployments where more tasks are running or failing than expected.
Enable task usage metrics
To enable task usage metrics for your entire Astronomer installation, configure the following values in your config.yaml
file:
global:
taskUsageMetricsEnabled: true
After you set this configuration, Astronomer Software begins to run a cron job for collecting task usage metrics at the 57th minute of every hour, sending them to Astronomer support, and displaying them in the Software UI. By default, your Astronomer installation retains this data for 90 days.
Set up task usage metrics on a Deployment (Required only for Astro Runtime < 7.2)
Task usage metrics are generated by the Astronomer-maintained airflow-analytics-plugin
. This plug-in queries the Airflow metadata database and returns usage analytics at an HTTP endpoint. Deployments using Runtime 7.2 or later have this plug-in installed by default.
To install the plug-in on a Deployment using Astro Runtime version 7.2 or earlier:
-
Add the following line to the
requirements.txt
file of your Astro project:https://github.com/astronomer/airflow-analytics-plugin/releases/download/1.0.3/astronomer_analytics_plugin-1.0.3-py3-none-any.whl
-
Push your changes to Astronomer Software. See Deploy code.
View task usage metrics
Depending on your permissions, you can view task usage metrics for a given installation, Workspace, or Deployment in the Software UI.
- View an installation's task usage: In the Software UI, go to System Admin > Task Usage. This page shows total task runs, as well as task runs per Workspace.
- View a Workspace's task usage: In the Software UI, select a Workspace and go to Task Usage. This page shows the Workspace's total task runs, as well as task runs per Deployment.
- View a Deployment's task usage: In the Software UI, select open a Workspace, select a Deployment in the Workspace, and go to Task Usage. This page shows the Deployment's total task runs, as well as task runs per day.