From 0a816c6f0b500e1b0515452e38e3446412f3e8e3 Mon Sep 17 00:00:00 2001 From: Matt Burke <84401060+mattogburke@users.noreply.github.com> Date: Tue, 3 Sep 2024 20:39:11 +0100 Subject: [PATCH] Correct scheduled slots documentation and missing open telemetry span (#41899) * Correct documentation for pool.scheduled_slots metrics * Add missing pool.scheduled_slots telemetry span --- airflow/jobs/scheduler_job_runner.py | 1 + .../logging-monitoring/metrics.rst | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/airflow/jobs/scheduler_job_runner.py b/airflow/jobs/scheduler_job_runner.py index 9b817ecc25716..feb047ec5d7d8 100644 --- a/airflow/jobs/scheduler_job_runner.py +++ b/airflow/jobs/scheduler_job_runner.py @@ -1844,6 +1844,7 @@ def _emit_pool_metrics(self, session: Session = NEW_SESSION) -> None: span.set_attribute(f"pool.queued_slots.{pool_name}", slot_stats["queued"]) span.set_attribute(f"pool.running_slots.{pool_name}", slot_stats["running"]) span.set_attribute(f"pool.deferred_slots.{pool_name}", slot_stats["deferred"]) + span.set_attribute(f"pool.scheduled_slots.{pool_name}", slot_stats["scheduled"]) @provide_session def adopt_or_reset_orphaned_tasks(self, session: Session = NEW_SESSION) -> int: diff --git a/docs/apache-airflow/administration-and-deployment/logging-monitoring/metrics.rst b/docs/apache-airflow/administration-and-deployment/logging-monitoring/metrics.rst index 82597712a8abc..f3e69a9541df8 100644 --- a/docs/apache-airflow/administration-and-deployment/logging-monitoring/metrics.rst +++ b/docs/apache-airflow/administration-and-deployment/logging-monitoring/metrics.rst @@ -242,8 +242,8 @@ Name Description ``pool.running_slots`` Number of running slots in the pool. Metric with pool_name tagging. ``pool.deferred_slots.`` Number of deferred slots in the pool ``pool.deferred_slots`` Number of deferred slots in the pool. Metric with pool_name tagging. -``pool.scheduled_tasks.`` Number of scheduled tasks in the pool -``pool.scheduled_tasks`` Number of scheduled tasks in the pool. Metric with pool_name tagging. +``pool.scheduled_slots.`` Number of scheduled slots in the pool +``pool.scheduled_slots`` Number of scheduled slots in the pool. Metric with pool_name tagging. ``pool.starving_tasks.`` Number of starving tasks in the pool ``pool.starving_tasks`` Number of starving tasks in the pool. Metric with pool_name tagging. ``task.cpu_usage_percent..`` Percentage of CPU used by a task