Skip to content

Conversation

@Shlomit-B
Copy link
Contributor

@Shlomit-B Shlomit-B commented Aug 3, 2025

Skips recording span and metrics in the scheduler when tracing or metrics are disabled. This avoids unnecessary function calls and improves efficiency.

Changes Made:

  • Added functions to check config values
  • Used these helpers to avoid computing span and pool metrics in _run_scheduler_loop when not needed

closes: #53405


Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@boring-cyborg boring-cyborg bot added the area:Scheduler including HA (high availability) scheduler label Aug 3, 2025
@Shlomit-B Shlomit-B force-pushed the bug/53405-skip-span-queries-when-disabled branch from cf25f1f to 0c85107 Compare August 4, 2025 04:59
@Shlomit-B Shlomit-B marked this pull request as ready for review August 4, 2025 05:34
@Shlomit-B Shlomit-B requested review from XD-DENG and ashb as code owners August 4, 2025 05:34
@ashb
Copy link
Member

ashb commented Aug 5, 2025

@xBis7 Looks okay to me -- are you able to take a quick look too?

Copy link
Contributor

@xBis7 xBis7 left a comment

Choose a reason for hiding this comment

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

LGTM!

@ashb ashb changed the title Bug/53405 skip span queries when disabled Skip running db queries for Spans when they are disabled Aug 6, 2025
@ashb ashb added the backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch label Aug 6, 2025
@ashb ashb force-pushed the bug/53405-skip-span-queries-when-disabled branch from 0c85107 to c44a4de Compare August 11, 2025 08:37
@ashb ashb force-pushed the bug/53405-skip-span-queries-when-disabled branch from c44a4de to 83927ce Compare August 12, 2025 09:55
@kaxil kaxil merged commit 67f5565 into apache:main Aug 12, 2025
57 checks passed
github-actions bot pushed a commit that referenced this pull request Aug 12, 2025
…54075)

Skips recording span and metrics in the scheduler when tracing or metrics are disabled. This avoids unnecessary function calls and improves efficiency.

Changes Made:

- Added functions to check config values
- Used these helpers to avoid computing span and pool metrics in _run_scheduler_loop when not needed
(cherry picked from commit 67f5565)

Co-authored-by: Shlomit-B <76184325+Shlomit-B@users.noreply.github.com>
closes: #53405
@github-actions
Copy link

Backport successfully created: v3-0-test

Status Branch Result
v3-0-test PR Link

github-actions bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Aug 12, 2025
…pache#54075)

Skips recording span and metrics in the scheduler when tracing or metrics are disabled. This avoids unnecessary function calls and improves efficiency.

Changes Made:

- Added functions to check config values
- Used these helpers to avoid computing span and pool metrics in _run_scheduler_loop when not needed
(cherry picked from commit 67f5565)

Co-authored-by: Shlomit-B <76184325+Shlomit-B@users.noreply.github.com>
closes: apache#53405
github-actions bot pushed a commit to astronomer/airflow that referenced this pull request Aug 12, 2025
…pache#54075)

Skips recording span and metrics in the scheduler when tracing or metrics are disabled. This avoids unnecessary function calls and improves efficiency.

Changes Made:

- Added functions to check config values
- Used these helpers to avoid computing span and pool metrics in _run_scheduler_loop when not needed
(cherry picked from commit 67f5565)

Co-authored-by: Shlomit-B <76184325+Shlomit-B@users.noreply.github.com>
closes: apache#53405
ashb pushed a commit that referenced this pull request Aug 12, 2025
…54075) (#54404)

Skips recording span and metrics in the scheduler when tracing or metrics are disabled. This avoids unnecessary function calls and improves efficiency.

Changes Made:

- Added functions to check config values
- Used these helpers to avoid computing span and pool metrics in _run_scheduler_loop when not needed
(cherry picked from commit 67f5565)

Co-authored-by: Shlomit-B <76184325+Shlomit-B@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Scheduler including HA (high availability) scheduler backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scheduler still runs span cleanup queries when tracing is disabled

4 participants