Skip to content

Add metrics for tracking stale secondaries for merge requests

Stan Hu requested to merge sh-add-matching-merge-request-metrics into master

To fix the merge requests failing to match due to replication lag (#247857 (closed)) we added a mechanism to track the WAL pointer of the merge request to decide whether to use the secondary or fall back to the primary. This commit adds metrics to better understand how often this fallback is occurring.

With a delayed replica, I see:

$ curl -s https://gdk.test:3001/-/metrics | grep mat
# HELP gitlab_merge_request_match_stale_secondary Multiprocess metric
# TYPE gitlab_merge_request_match_stale_secondary counter
gitlab_merge_request_match_stale_secondary 1
# HELP gitlab_merge_request_match_total Multiprocess metric
# TYPE gitlab_merge_request_match_total counter
gitlab_merge_request_match_total 1
Edited by Stan Hu

Merge request reports

Loading