Make billed users scan rate limits configurable

What does this MR do and why?

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

How to set up and validate locally

  1. 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, and seat_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"
  2. 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"
  3. As an owner of a top-level group, run this query in GraphiQL explorer 3 times.

    query {
      group(fullPath: "<group_path>") {
        billableMembersCount
      }
    }
    1. All 3 return the count. In log/development_json.log, the third request's rate_limit_state includes applimiter_billed_users_scan_per_minute:limit_billed_users_scans_per_minute_by_user_namespace_log:log.

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

Merge request reports

Loading
Loading