kaxil commented on code in PR #52815:
URL: https://github.com/apache/airflow/pull/52815#discussion_r2314605866
##########
airflow-core/src/airflow/dag_processing/manager.py:
##########
@@ -1014,6 +1018,13 @@ def prepare_file_queue(self, known_files: dict[str,
set[DagFileInfo]]):
self._add_files_to_queue(to_queue, False)
Stats.incr("dag_processing.file_path_queue_update_count")
+ def _emit_running_dags_metric(self):
+ """Emit executor.running_dags gauge."""
+ with create_session() as session:
+ 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:
This will run a query even when a user does not intend to send metrics
anywhere i.e. when none of the following is enabled:
- `[metrics] statsd_datadog_enabled`
- `[metrics] statsd_on`
- `[metrics] otel_on`
--
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]