Rate limit the project VSA JSON endpoints
What does this MR do and why?
MR 3 of https://gitlab.com/gitlab-org/gitlab/-/work_items/636168 (Project Bulkhead, Optimize row 3). Follows !267822 (merged).
The three project VSA JSON endpoints have no rate limit, and about 98% of their traffic is anonymous:
GET /<project>/-/analytics/value_stream_analytics/summary(and the EEtime_summary)GET /<project>/-/value_stream_analytics.jsonGET /<project>/-/value_stream_analytics/events/<stage>.json
This adds a project_value_stream_analytics key to the rate-limit registry: 60 requests a minute per project, per user, or per IP for anonymous callers. check_rate_limit! runs on all three after the authorization check. For CycleAnalyticsController#show it only runs on JSON, so the HTML page isn't counted. On the events actions it runs for every format, because they run the events query before respond_to, the same as the date range check from !267822 (merged).
The key is a staged_rule behind the project_value_stream_analytics_rate_limit flag (gitlab_com_derisk, default off, project actor). With the flag off it runs in log mode: requests over 60 a minute are logged but not blocked. Enabling the flag for a project enforces the limit there.
Threshold: checked in Kibana over the 7 days to 2026-11-09. The busiest minute on these endpoints was 35 requests across all callers (2026-11-04 00:07 UTC), and the busiest hour averaged about 17 a minute. That hour's traffic was spread across hundreds of IPs and projects: the top IP and the top project each had about 9 requests in the hour. Nothing seen this week would have been throttled at 60/min. The limit guards against one caller hammering a project; the spread-out crawler traffic is handled by the 180-day range cap from !267822 (merged), which keeps each request cheap.
How to set up and validate locally
Feature.enable(:project_value_stream_analytics_rate_limit)Logged out, hit /<ns>/<project>/-/value_stream_analytics.json 61 times in a minute from the same IP. The 61st call returns 429. Repeat with the flag disabled and every call returns 200.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist.
Related to https://gitlab.com/gitlab-org/gitlab/-/work_items/636168