wilmerdooley commented on issue #63503: URL: https://github.com/apache/airflow/issues/63503#issuecomment-4568908522
I had a look at this one. The root cause is that `queued_duration` is emitted by `TaskInstance.emit_state_change_metric(RUNNING)`, which in Airflow 2 ran when the task transitioned to RUNNING. In Airflow 3 that transition moved to the execution API (the `ti_run` route), so the call site in `taskinstance.py` no longer fires and the metric is never emitted. Its sibling `scheduled_duration` still works because it is emitted on the QUEUED transition, which is still triggered server side from the scheduler (`scheduler_job_runner`). The change that keeps the two symmetric is to emit `task.queued_duration` server side in the `ti_run` handler when a task goes from QUEUED to RUNNING, computing `now - queued_dttm`. The metric template already maps `task.queued_duration` to the legacy `dag.<dag_id>.<task_id>.queued_duration` name, so both the tagged and statsd forms are covered. @seanmuth are you planning to take this one? If not, I am happy to open a PR with a test. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
