nailo2c commented on code in PR #52815:
URL: https://github.com/apache/airflow/pull/52815#discussion_r2462183397


##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -2235,6 +2240,12 @@ def _emit_running_ti_metrics(self, session: Session = 
NEW_SESSION) -> None:
 
         self.previous_ti_running_metrics = ti_running_metrics
 
+    @provide_session
+    def _emit_running_dags_metric(self, session: Session = NEW_SESSION) -> 
None:
+        stmt = select(func.count()).select_from(DagRun).where(DagRun.state == 
DagRunState.RUNNING)
+        running_dags = session.scalar(stmt)
+        Stats.gauge("executor.running_dags", running_dags)

Review Comment:
   Thanks for the review. I kept the metric name `executor.running_dags` 
because it was used in the original issue. Since we all agree to emit it in 
`scheduler_job_runner.py`, it makes more sense to place it under `scheduler`. 
I'll update the PR later.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to