From 4fa71584a325965327a312682530b246d78fec13 Mon Sep 17 00:00:00 2001 From: "Z.J. van de Weg" Date: Wed, 7 Jun 2017 17:12:23 +0200 Subject: Add prometheus metrics on pipeline creation --- app/services/ci/create_pipeline_service.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/services') diff --git a/app/services/ci/create_pipeline_service.rb b/app/services/ci/create_pipeline_service.rb index bffec216819..769749c9925 100644 --- a/app/services/ci/create_pipeline_service.rb +++ b/app/services/ci/create_pipeline_service.rb @@ -57,6 +57,8 @@ module Ci cancel_pending_pipelines if project.auto_cancel_pending_pipelines? + pipeline_created_counter.increment(source: source) + pipeline.tap(&:process!) end @@ -131,5 +133,9 @@ module Ci pipeline.drop if save pipeline end + + def pipeline_created_counter + @pipeline_created_counter ||= Gitlab::Metrics.counter(:pipelines_created_count, "Pipelines created count") + end end end -- cgit v1.2.1