Skip to content

Add team_name tag to Celery executor metrics - #69092

Merged
ferruzzi merged 1 commit into
apache:mainfrom
SameerMesiah97:68996-Celery-Team-Name-Metrics
Jul 7, 2026
Merged

Add team_name tag to Celery executor metrics#69092
ferruzzi merged 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

@SameerMesiah97
SameerMesiah97 force-pushed the 68996-Celery-Team-Name-Metrics branch 2 times, most recently 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
@potiuk potiuk added the ready for maintainer review Set after triaging when all criteria pass. label Jul 2, 2026
@SameerMesiah97

Copy link
Copy Markdown
Contributor Author

@ferruzzi

I was hoping you could review this.

@ferruzzi

ferruzzi commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Ah, I didn't see it until you tagged me, I'll check it out.

@ferruzzi ferruzzi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One trivial nit in the tests and one actual request for backcompat in the code; reasoning for skipping celery.execute_command.failure seems sound.

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 36e5e52 to 8bbf10b Compare July 6, 2026 20:50
@SameerMesiah97

Copy link
Copy Markdown
Contributor Author

@ferruzzi

Thanks for the review. I have responded to your comments and have just rebased the branch.

@SameerMesiah97
SameerMesiah97 requested a review from ferruzzi July 6, 2026 22:10
@ferruzzi
ferruzzi merged commit dc5ddd2 into apache:main Jul 7, 2026
79 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants