This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 215a031f61 Add hostname to triggerer metric [triggers.running] (#32050)
215a031f61 is described below

commit 215a031f611d04d551ca5f95bb52496b4d5bc123
Author: Artur Piotr Izaak Laskowski <[email protected]>
AuthorDate: Tue Jun 27 19:37:06 2023 +0200

    Add hostname to triggerer metric [triggers.running] (#32050)
    
    
    ---------
    
    Co-authored-by: D. Ferruzzi <[email protected]>
---
 airflow/jobs/triggerer_job_runner.py                                 | 5 ++++-
 .../administration-and-deployment/logging-monitoring/metrics.rst     | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/airflow/jobs/triggerer_job_runner.py 
b/airflow/jobs/triggerer_job_runner.py
index 79b5e953dc..91bd3dbd02 100644
--- a/airflow/jobs/triggerer_job_runner.py
+++ b/airflow/jobs/triggerer_job_runner.py
@@ -401,7 +401,10 @@ class TriggererJobRunner(BaseJobRunner["Job | 
JobPydantic"], LoggingMixin):
             Stats.incr("triggers.failed")
 
     def emit_metrics(self):
-        Stats.gauge("triggers.running", len(self.trigger_runner.triggers))
+        Stats.gauge(f"triggers.running.{self.job.hostname}", 
len(self.trigger_runner.triggers))
+        Stats.gauge(
+            "triggers.running", len(self.trigger_runner.triggers), 
tags={"hostname": self.job.hostname}
+        )
 
 
 class TriggerDetails(TypedDict):
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 2322348636..02279fbb03 100644
--- 
a/docs/apache-airflow/administration-and-deployment/logging-monitoring/metrics.rst
+++ 
b/docs/apache-airflow/administration-and-deployment/logging-monitoring/metrics.rst
@@ -198,7 +198,7 @@ Name                                                
Description
 ``pool.queued_slots.<pool_name>``                   Number of queued slots in 
the pool
 ``pool.running_slots.<pool_name>``                  Number of running slots in 
the pool
 ``pool.starving_tasks.<pool_name>``                 Number of starving tasks 
in the pool
-``triggers.running``                                Number of triggers 
currently running (per triggerer)
+``triggers.running.<hostname>``                     Number of triggers 
currently running for a triggerer (described by hostname)
 =================================================== 
========================================================================
 
 Timers

Reply via email to