Measure pipeline durations of deployment pipeline downstream pipelines
Summary
We would like to measure the durations of downstream pipelines in the deployment pipeline.
Job durations will be measured as part of #2891 (closed), but the pipeline duration is not simply the aggregation of the duration of all of the pipeline's jobs. For example, some jobs run at the same time. Or a job might fail, and then be retried manually by an RM, which adds an unmeasured amount of time between retries.
Proposal
Add a gauge named deployment_pipeline_duration_seconds
with the following labels:
- pipeline_name: Name of the pipeline. This should match with the values of the
pipeline_name
label of the job duration metric from #2891 (closed). - upstream_pipeline_name: Name of the pipeline that triggered this pipeline. This should also match the values of the
pipeline_name
label of the job duration metric. - version or deploy_version:
DEPLOY_VERSION
value. - project: Name of the project in which the pipeline runs.
Implemented
Example metric without labels added by scrapers:
delivery_deployment_pipeline_duration_seconds{deploy_version="15.11.202304201120-040246fea8b.0c2f103500c", project_name="gitlab-com/gl-infra/deployer", target_env="gprd", target_stage="cny"}
Edited by Reuben Pereira