airflow-prometheus-exporter icon indicating copy to clipboard operation
airflow-prometheus-exporter copied to clipboard

How to determine the number of tasks currently running?

Open estahn opened this issue 6 years ago • 3 comments

Questions:

  • How to determine the number of tasks currently running?
  • How to determine how long it took for a task to finish?

estahn avatar Nov 13 '18 05:11 estahn

Determining how many tasks are running is not possible (yet at least...) You can however use the airflow_dag_run_state metric to see how many and when certain events happened (success, failed, running)

I think that task duration would be way too much data to export, since it would need a separate metric/dimension for every task instance. Maybe a different approach to this would be possible by counting the number of seconds taken and the number of tries or something... But it isn't possible at this moment.

DemonTPx avatar Nov 13 '18 07:11 DemonTPx

@DemonTPx We want to use the metric to scale up pods in Kubernetes. Any idea what metric would be useful for that? We thought something like queue size.

estahn avatar Nov 16 '18 06:11 estahn

We use the GCP Composer and the Stackdriver Exporter for that metric. But that does not help you, if you are using a native Aiflow deployment. https://cloud.google.com/monitoring/api/metrics_gcp#gcp-composer

colleym avatar Jan 27 '21 10:01 colleym