Emit Airflow metrics to support analysing Cosmos performance #991
Labels
area:performance
Related to performance, like memory usage, CPU usage, speed, etc
area:rendering
Related to rendering, like Jinja, Airflow tasks, etc
parsing:custom
Related to custom parsing, like custom DAG parsing, custom DBT parsing, etc
parsing:dbt_ls
Issues, questions, or features related to dbt_ls parsing
parsing:dbt_manifest
Issues, questions, or features related to dbt_manifest parsing
Milestone
Context
We want more visibility on how much Cosmos spends while parsing the dbt project and building the Airflow DAG.
We'd like to leverage Airflow Metrics collection system by using:
To collect the following metrics:
cosmos.load_method_custom.duration
: time taken to runDbtGraph.load_via_custom_parser
cosmos.load_method_dbt_ls.duration
: time taken to runDbtGraph.load_via_dbt_ls
cosmos.load_method_dbt_ls_file.duration
: time taken to runDbtGraph.load_via_dbt_ls_file
cosmos.load_method_manifest.duration
: time taken to runDbtGraph.load_from_dbt_manifest
cosmos.convert_to_airflow.duration
: time taken to run `build_airflow_graph``cosmos.dag_init.duration
: time taken to initialise the Airflow DAGcosmos.dag_new.duration
: time taken to create the Airflow DAGcosmos.task_group_init.duration
: time taken to initialise the Airflow DAG (__init__
)cosmos.task_group_new.duration
: time taken to create the Airflow DAG (__new__
)Relevant parts of the code:
astronomer-cosmos/cosmos/dbt/graph.py
Lines 168 to 171 in cda2a50
astronomer-cosmos/cosmos/airflow/graph.py
Line 215 in cda2a50
https://github.com/astronomer/astronomer-cosmos/blob/main/cosmos/airflow/dag.py
https://github.com/astronomer/astronomer-cosmos/blob/main/cosmos/airflow/task_group.py
Acceptance criteria
The text was updated successfully, but these errors were encountered: