Loading
Make billed users scan rate limits configurable
What does this MR do and why?
- Makes the billed users scan and seat usage export rate limits configurable through the application settings API
- It also raises the billed users scan defaults, based on the log-only data from GitLab.com (see https://gitlab.com/gitlab-org/gitlab/-/work_items/639222#note_4270672580).
Enforcement is still controlled by the enforce_billed_users_scan_rate_limits feature flag. With the flag disabled, requests over these limits are only logged.
References
- https://gitlab.com/gitlab-org/gitlab/-/work_items/636108
- https://gitlab.com/gitlab-org/gitlab/-/work_items/639222
How to set up and validate locally
-
As an administrator, check the defaults for
billed_users_scan_per_minute_limit,billed_users_scan_per_hour_limit,billed_users_scan_per_day_limit, andseat_usage_export_limit. They return 500, 2500, 20000 and 10 respectively.curl --header "PRIVATE-TOKEN: <admin_token>" "http://gdk.test:3000/api/v4/application/settings" -
Lower the per-minute limit:
curl --request PUT --header "PRIVATE-TOKEN: <admin_token>" \ "http://gdk.test:3000/api/v4/application/settings?billed_users_scan_per_minute_limit=2" -
As an owner of a top-level group, run this query in GraphiQL explorer 3 times.
query { group(fullPath: "<group_path>") { billableMembersCount } }- All 3 return the count. In
log/development_json.log, the third request'srate_limit_stateincludesapplimiter_billed_users_scan_per_minute:limit_billed_users_scans_per_minute_by_user_namespace_log:log.
- All 3 return the count. In
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Katherine Richards