apache / apache/airflow

Expose queued_dttm on RuntimeTaskInstance for listener hooks

Open
#66,373 1 comment 0 reactions 1 assignee Claimed by @jroachgolf84 View on GitHub
area:core kind:feature
Dominant language
Python
Stars
46.9k
Forks
17.8k
Avg merge
2d 9h
Merged PRs (30d)
472

Description

### Description

Listener hooks receive a RuntimeTaskInstance that does not include queued_dttm. This timestamp exists on the TaskInstance model in the metadata DB but is not passed through TIRunContext in the Execution API to the Task SDK.

In Airflow 2, listeners received a TaskInstance with queued_dttm available. In Airflow 3, this field is absent from RuntimeTaskInstance, with no client-side alternative to derive it.

### Use case/motivation

Observability integrations and custom listeners need queued_dttm to measure queue wait time, how long a task waited for a worker before execution started

### Related issues

https://github.com/apache/airflow/pull/64600 draft implementation that adds queued_dttm to TIRunContext and RuntimeTaskInstance

### Are you willing to submit a PR?

- [x] Yes I am willing to submit a PR!

### Code of Conduct

- [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.