Add feature_category to rate limit block summary lines

What does this MR do and why?

Adds feature_category to rate_limit_block_summary lines, so a team can filter blocks to its own endpoints.

  • EndpointResolver#resolve returns the endpoint_id and the category from the same route or controller match. No second lookup table.
  • The lookup runs inside the existing rescue. On error both values fall back to unknown.
  • Endpoints with no declared category record unknown, the default the request SLIs use (RequestsRackMiddleware::FEATURE_CATEGORY_DEFAULT).
  • LabKit's BlockSummary#add already accepts feature_category:. Line count does not change.

The code runs only on blocked requests, behind rate_limiter_endpoint_block_summary.

References

  • Task: #639980
  • Rollout: #638075
  • Conflicts with !270340 in count_block. Whichever merges second rebases.

How to validate locally

bundle exec rspec spec/lib/gitlab/rack_attack/labkit_rate_limit/endpoint_resolver_spec.rb spec/lib/gitlab/middleware/labkit_rack_rate_limit_spec.rb

87 examples, 0 failures locally.

Review checklist

  • Category comes from the matched route, HEAD gets the GET route's category
  • No resolver call outside the rescue
  • unknown default matches the request SLI labels
  • Specs cover raise, no category, and HEAD
  • Teammate review before maintainer

Merge request reports

Loading
Loading