Add job count metric for pipeline execution policy
What does this MR do and why?
This MR adds a new metric to count the number of jobs executed by pipeline execution policies.
Related to: #436055 (closed)
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
How to set up and validate locally
- Enable the
pipeline_execution_policy_type
feature flag
Feature.enable(:pipeline_execution_policy_type)
- Create a new Group
- Create a new project
- Add a
.gitlab-ci.yml
with the content
test1:
stage: test
script:
- echo "Do a test here"
- echo "For example run a test suite"
test2:
stage: test
script:
- echo "Do another parallel test here"
- echo "For example run a lint test"
-
Create another project
-
Go to Secure > Policies
-
Click in New policy
-
Select Pipeline execution policy
-
Create a new policy injecting the content from the
.gitlab-ci.yml
created in the step 3 -
Click in update via merge request
-
Start the event monitoring running the command bellow in the
gdk-folder/gitlab
directory
rails runner scripts/internal_events/monitor.rb execute_job_pipeline_execution_policy
- Go to Build > Pipelines and run a pipeline
- Check if the counter was increased by 2 in the event monitoring.
Edited by Marcos Rocha