Skip to content

Metrics - Introducing a counter for number of DAGs in "running" state #12368

@SolbiatiAlessandro

Description

@SolbiatiAlessandro

Description

Could we introduce a new counter in Airflow Metrics to track number of DAGs that are in 'running' state?

I am aware of the existing dag_processing.processes counter that is documented as Number of currently running DAG parsing processes. This counter track how many dags are being parsed, not how many are runnings.

I am aware of the existing executor.queued_tasks and executor.running_tasks, but they are task-wise and not dag-wise.

Use case / motivation

Consider this example
Screenshot 2020-11-14 at 16 42 40

I want to know how many DAGs are in the state of running to understand memory consumption issues and to understand how long is my "queue" of DAGs. To my understanding there is no metric currently that I can use to track that.

I propose a counter executor.running_dags that would return the number of DAGs in the running state.

Does this make sense? Am I missing something? If folks I agree I would be happy to work on a PR :)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions