Report initial pipeline changes under correct key
The normal pipeline gauge uses this key, but the initial gauge
was not yet updated.
Change-Id: Icc150eae0afe15e54bd9f3cddbe534ec2555dc10
diff --git a/tests/unit/test_scheduler.py b/tests/unit/test_scheduler.py
index 75b88fb..8023ef6 100755
--- a/tests/unit/test_scheduler.py
+++ b/tests/unit/test_scheduler.py
@@ -135,9 +135,11 @@
def test_initial_pipeline_gauges(self):
"Test that each pipeline reported its length on start"
- self.assertReportedStat('zuul.pipeline.gate.current_changes',
+ self.assertReportedStat('zuul.tenant.tenant-one.pipeline.gate.'
+ 'current_changes',
value='0|g')
- self.assertReportedStat('zuul.pipeline.check.current_changes',
+ self.assertReportedStat('zuul.tenant.tenant-one.pipeline.check.'
+ 'current_changes',
value='0|g')
def test_job_branch(self):
diff --git a/zuul/scheduler.py b/zuul/scheduler.py
index 62ad4fa..f3cb479 100644
--- a/zuul/scheduler.py
+++ b/zuul/scheduler.py
@@ -679,8 +679,10 @@
try:
for pipeline in tenant.layout.pipelines.values():
items = len(pipeline.getAllItems())
- # stats.gauges.zuul.pipeline.NAME.current_changes
- key = 'zuul.pipeline.%s' % pipeline.name
+ # stats.gauges.zuul.tenant.<tenant>.pipeline.
+ # <pipeline>.current_changes
+ key = 'zuul.tenant.%s.pipeline.%s' % (
+ tenant.name, pipeline.name)
self.statsd.gauge(key + '.current_changes', items)
except Exception:
self.log.exception("Exception reporting initial "