Add in-depth duration measuring for code owner approval methods
What does this MR do and why?
This MR reintroduces performance instrumentation to measure the duration of code owner approval operations in MergeRequests::ResetApprovalsService, with more granular sub-operation measurements than the previous implementation.
The instrumentation is behind the log_merge_request_reset_approvals_duration feature flag and logs detailed timing data to help identify performance bottlenecks in the code owner approval reset flow.
Metrics Logged
| Metric | Description |
|---|---|
delete_code_owner_approvals_total_duration_s |
Total time for the entire code owner deletion flow |
find_approved_code_owner_rules_total_duration_s |
Time to find code owner rules with approved approvers |
code_owner_approver_ids_to_delete_total_duration_s |
Total time for approver ID extraction |
code_owner_approver_ids_previous_diff_sha_duration_s |
Time to get previous diff SHA |
code_owner_approver_ids_entries_since_commit_duration_s |
Time for CodeOwners.entries_since_merge_request_commit
|
code_owner_approver_ids_match_rules_duration_s |
Time to match rules and extract IDs |
code_owner_approver_ids_filter_approvals_duration_s |
Time to filter approvals by user IDs |
perform_code_owner_approval_deletion_total_duration_s |
Total time for the deletion operation |
perform_deletion_check_approval_state_duration_s |
Time to check if MR was approved |
perform_deletion_delete_all_duration_s |
Time for the actual delete_all query |
perform_deletion_expire_keys_duration_s |
Time to expire cache keys |
perform_deletion_update_reviewer_state_duration_s |
Time to update reviewer states |
perform_deletion_trigger_events_duration_s |
Time for internal event triggers |
perform_deletion_webhooks_duration_s |
Time for webhook execution |
reset_approvals_service_total_duration_s |
Sum of all measured durations |
Related Issues
- Previous implementation removed in: !215010 (merged)
- Original feature issue: https://gitlab.com/gitlab-org/gitlab/-/issues/548046
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist.
Changelog: other