Add instrumentation for external pipeline validation
What does this MR do and why?
This MR adds granular instrumentation to the external pipeline validation process to help diagnose performance issues.
Currently, we track the overall duration of Validate::External step, but we cannot distinguish between:
- Time spent generating the validation payload
- Time spent waiting for the external validation service to respond
Investigation has revealed that the number of slow requests reported in PVS (Pipeline Validation Service) logs differs from what we observe in GitLab logs (see this comment). This discrepancy suggests we need better instrumentation to understand where the slowness actually occurs.
This change introduces two separate instrumentation points:
pipeline_validate_external_payload_duration_spipeline_validate_external_request_duration_s
With this instrumentation, we can verify whether the slowness in pipeline_step_gitlab_ci_pipeline_chain_validate_external is actually coming from the PVS response time or from other factors in our pipeline creation process.
Related issues
Related to Slow `Validate::External` on pipeline creation (#572929)
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.