Skip to content

Add/port metrics to the new Execution interface #45511

Description

@kaxil

Find a way to emit metrics from the new supervisor process.

Some examples of what needs porting over:

Stats.incr("local_task_job_prolonged_heartbeat_failure", 1, 1)

def _log_return_code_metric(self, return_code: int):
Stats.incr(
"local_task_job.task_exit."
f"{self.job.id}.{self.task_instance.dag_id}.{self.task_instance.task_id}.{return_code}"
)
# Same metric with tagging
Stats.incr(
"local_task_job.task_exit",
tags={
"job_id": self.job.id,
"dag_id": self.task_instance.dag_id,
"task_id": self.task_instance.task_id,
"return_code": return_code,
},
)

Activity

  1. converted this from a draft issue on Jan 9, 2025
  2. added this to the Airflow 3.0.0 milestone on Jan 17, 2025
  3. KoviAnusha commented on Oct 22, 2025

    @KoviAnusha
    Contributor

    @kaxil is this still open? If so, can I work on this?

  4. kaxil commented on Oct 22, 2025

    @kaxil
    MemberAuthor

    Yes still open, and assigned to you

  5. KoviAnusha commented on Oct 24, 2025

    @KoviAnusha
    Contributor

    Thank you

  6. antonlin1 commented on Dec 4, 2025

    @antonlin1
    Contributor

    not sure if ti failure metrics are out of scope for this issue? I didn't see it being handled in the associated PR. Otherwise I put up #59072

  7. antonlin1 commented on Dec 5, 2025

    @antonlin1
    Contributor

    @kaxil , is the idea to centralise all previously task process emitted metrics (in airflow 2) to supervisor? #59072 follows airflow 2 very closely in that it's emitted from task runner rather than supervisor.

  8. michaelfu1029 commented on Jan 12, 2026

    @michaelfu1029

    Will TaskInstanceStarted and TaskInstanceFinished be covered in this issue?

  9. amoghrajesh commented on Feb 12, 2026

    @amoghrajesh
    Contributor

    All the related issues are closed, I think we emit all the metrics we did with Airflow 2 now.

    #53722 was the PR that ported over the infra and we have had incremental PRs adding metrics like: #55322, #59731. The intent of this task is complete. However, if there are more issues to be created, follow it on with PRs as you like.

    @michaelfu1029 for example ^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions