Skip to content

Statistics not updated after failure #52254

@zlokomatic

Description

@zlokomatic

Apache Airflow version

3.0.2

If "Other Airflow 2 version" selected, which one?

No response

What happened?

After a task failed the values for ti_failures are not increased.

As we are using statsd/prometheus to monitor airflow_ti_failures for task failures we are not alarmed about this.

What you think should happen instead?

A failing task should increase ti_failures

How to reproduce

Environment

    AIRFLOW__METRICS__STATSD_ON: 'true'
    AIRFLOW__METRICS__STATSD_HOST: 'statsd_exporter'
    AIRFLOW__METRICS__STATSD_PORT: '9125'
    AIRFLOW__METRICS__STATSD_DATADOG_ENABLED: 'true'

Activate statsd server

Dag:

from airflow import DAG
from airflow.operators.bash import BashOperator
from datetime import datetime, timedelta

with DAG(
    dag_id="failure_handling_dag",
    start_date=datetime(2025, 4, 1),
    schedule="@daily",
    catchup=False,
) as dag:

    fail_task = BashOperator(
        task_id="fail_task",
        bash_command="sleep 5 && exit 1",
    )

Operating System

Ubuntu 22.04.5 LTS

Versions of Apache Airflow Providers

Default with apache-airflow 3.0.2 docker image

Deployment

Docker-Compose

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions