Skip to content

Add team_name tag to Celery executor metrics#69092

Open
SameerMesiah97 wants to merge 1 commit into
apache:mainfrom
SameerMesiah97:68996-Celery-Team-Name-Metrics
Open

Add team_name tag to Celery executor metrics#69092
SameerMesiah97 wants to merge 1 commit into
apache:mainfrom
SameerMesiah97:68996-Celery-Team-Name-Metrics

Conversation

@SameerMesiah97

@SameerMesiah97 SameerMesiah97 commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Description

This change adds the team_name tag to the celery.task_timeout_error metric emitted by the Celery executor when retrying workload publication after an AirflowTaskTimeout.

The celery.execute_command.failure metric was intentionally left unchanged. That metric is only emitted by execute_command(), which is used on Airflow versions prior to 3.0, whereas multi-team support (and team_name) was introduced in Airflow 3.1. As a result, there is no supported execution path where celery.execute_command.failure can be associated with a team.

Rationale

The celery.task_timeout_error metric is used to identify workload publication timeouts. Adding the team_name tag allows these events to be attributed to the owning team in multi-team deployments, making it easier to diagnose publish failures and identify affected teams.

Tests

Added a unit test covering the previously untested workload publication timeout retry path. The test verifies that celery.task_timeout_error is emitted with the expected tags both with and without team_name.

Backwards Compatibility

This change is additive only. The team_name tag is only emitted when available; otherwise, the metric is emitted unchanged.

Related: #68996

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: [GPT 5.5] following the guidelines

metric to improve per-team observability in multi-team deployments.

Add unit test coverage for the task timeout retry path, verifying
that the metric is emitted with and without the team_name tag.
@SameerMesiah97 SameerMesiah97 force-pushed the 68996-Celery-Team-Name-Metrics branch from bcf37a6 to 36e5e52 Compare June 28, 2026 13:07
@SameerMesiah97 SameerMesiah97 marked this pull request as ready for review June 28, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant