fix: log requests exceeding the rate limiting #52798
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Makes it a bit easier to find blocked requests due to rate limiting, similar to what we do for the bfp throttle.
Example user:
{ "reqId": "HPn5tPcQdhZCCs7LjQ9P", "level": 1, "time": "2025-05-13T16:59:00+00:00", "remoteAddr": "172.18.0.1", "user": "bob", "app": "no app in context", "method": "POST", "url": "/ocs/v2.php/apps/files_sharing/api/v1/shares", "message": "Request blocked because it exceeds the rate limit [method: OCA\\Files_Sharing\\Controller\\ShareAPIController::createShare, limit: 20, period: 600]", "userAgent": "IntelliJ HTTP Client/PhpStorm 2025.1.0.1", "version": "32.0.0.0", "data": [] }Example anon:
{ "reqId": "2kWZvzMS0ECmcf2HdmW8", "level": 1, "time": "2025-05-13T17:02:06+00:00", "remoteAddr": "172.18.0.1", "user": "--", "app": "no app in context", "method": "GET", "url": "/index.php/u/alice", "message": "Request blocked because it exceeds the rate limit [method: OCA\\Profile\\Controller\\ProfilePageController::index, limit: 5, period: 120]", "userAgent": "IntelliJ HTTP Client/PhpStorm 2025.1.0.1", "version": "32.0.0.0", "data": [] }Checklist