Create dry-run mode for Rack::Attack
There is a risk that when Rate Limiting is enabled, we do not set the rates appropriately. If customers are negatively impacted, we could land up creating more incidents where users are reaching out for help with changing their limits.
When rate limiting was discussed previously, there was concern about how we can safely set limits and how we could know which customers would be impacted.
The intention would be to enable this for a short timeframe in order to make good choices about limits. Self-managed customers could also use this method to determine their own limits. While we would not change the UI to show this feature (that could be done in a separate iteration), we would need to document how to enable and disable it.
- We allow a
GITLAB_THROTTLE_DRY_RUNenv var to be set. This is either:
*, meaning all throttles.
- A comma-separated list of throttle names from https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/initializers/rack_attack.rb:
- #629 (comment 441729559) has some implementation notes.
- We ensure the dry-run status shows up in a useful way in the rack attack log