Add prometheus metrics on pipeline creation
This commit is contained in:
parent
6ee216c4d9
commit
4fa71584a3
2 changed files with 10 additions and 0 deletions
|
@ -57,6 +57,8 @@ module Ci
|
||||||
|
|
||||||
cancel_pending_pipelines if project.auto_cancel_pending_pipelines?
|
cancel_pending_pipelines if project.auto_cancel_pending_pipelines?
|
||||||
|
|
||||||
|
pipeline_created_counter.increment(source: source)
|
||||||
|
|
||||||
pipeline.tap(&:process!)
|
pipeline.tap(&:process!)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -131,5 +133,9 @@ module Ci
|
||||||
pipeline.drop if save
|
pipeline.drop if save
|
||||||
pipeline
|
pipeline
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def pipeline_created_counter
|
||||||
|
@pipeline_created_counter ||= Gitlab::Metrics.counter(:pipelines_created_count, "Pipelines created count")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
4
changelogs/unreleased/zj-prom-pipeline-count.yml
Normal file
4
changelogs/unreleased/zj-prom-pipeline-count.yml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
title: Add prometheus metrics on pipeline creation
|
||||||
|
merge_request:
|
||||||
|
author:
|
Loading…
Reference in a new issue