Enable the pipeline creation logger by default
What does this MR do and why?
This MR enables the ci_pipeline_creation_logger ops feature flag by default.
In config/feature_flags/ops/ci_pipeline_creation_logger.yml:
default_enabledchanges fromfalsetotrue.milestonechanges from'14.5'to'19.5'. This bump records the yearly review thatopsflags require.
Nothing else changes.
The flag controls Gitlab::Ci::Pipeline::Logger. The logger writes one structured line to application_json.log for each pipeline creation, but only when one of these thresholds is crossed:
- Any measured step takes 3 seconds or more.
- Pipeline creation takes 20 seconds or more.
- The pipeline has 2000 or more jobs.
- The pipeline has 500 or more pipeline variables.
- A pipeline variable value is 200 KiB or larger.
!253383 (merged) added the pipeline variable thresholds.
When the flag is on, the logger also times chain steps and counts the database queries around them. Tag scanning runs only when a line is written. For pipeline variables, only counts and byte sizes are logged. Variable keys and values are never logged.
The flag has been fully enabled on GitLab.com since December 2021, so this MR changes nothing there. GitLab Dedicated does not support feature flags, so Dedicated never produces these logs today. With the flag on by default, Dedicated gets the same pipeline creation logs as GitLab.com for triage. GitLab Self-Managed instances also start writing these lines.
Specs already cover both flag states in spec/lib/gitlab/ci/pipeline/logger_spec.rb and spec/services/ci/create_pipeline_service/logger_spec.rb. No spec changes are needed.
References
- Original flag MR: !72996 (merged)
- Pipeline variable thresholds: !253383 (merged)
- Review discussion on !255889 (closed):
Screenshots or screen recordings
Not applicable. There is no UI change.
How to set up and validate locally
- Make sure the flag has no stored override. For example, run
Feature.remove(:ci_pipeline_creation_logger)in a Rails console. - Create a pipeline that crosses a threshold. For example, pass 500 or more pipeline variables through the API, or trigger a slow pipeline creation.
- Check
log/application_json.logfor an entry with"class":"Gitlab::Ci::Pipeline::Logger".
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.