Add monitoring for diff limits
Problem to solve
There are hard limits for how large a diff GitLab will show in the merge request, in total and by file, but we don't know how frequently these limits are being reached.
When these limits are reached the user experience is degraded because significant portions of the merge request may be collapsed or hidden by default causing the user to click expand one by one on these files. It may be worse if the file count is too large causing the entire merge request diff to be truncated to the first 1000 files.
Further details
We want to know how often and which limits are being reached today.
We also want to make changes to the interface that improve the experience for users by loading data progressively, and ultimately on demand by introducing a file by file diff mode.
Knowing which limits are being hit, and understanding change over time will help us prioritize and measure the impact of changes we make to improve usability.
Proposal
When a diff limit is triggered, log the diff limit that was triggered so that we can monitor this in a dashboard over time.