Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rate limiting: include rate limit names in global rate limiter response #10556

Closed
dweitzman opened this issue Mar 27, 2020 · 0 comments · Fixed by #10557
Closed

Rate limiting: include rate limit names in global rate limiter response #10556

dweitzman opened this issue Mar 27, 2020 · 0 comments · Fixed by #10557

Comments

@dweitzman
Copy link
Contributor

Title: include rate limit names in global rate limiter response

Description:
The proposal is to update api/envoy/service/ratelimit/v3/rls.proto to add a name, description, or id field to the "RateLimit" message.

This RateLimit message isn't used by envoy today. It seems to be purely information to direct clients of the API (not through envoy), presumably to aid with debugging or support non-envoy clients that might interpret the detailed breakdown of rate limits impacting a request.

Here's a sketch of a rate limit response with the new proposed field:

{
  "overall_code": OVER_LIMIT,
  "statuses": [{
    "code": OVER_LIMIT,
    "current_limit": {
      "requests_per_unit": 10,
      "unit": MINUTE,
      "name": "requests_per_user" << PROPOSED NEW FIELD
    },
    "limit_remaining": 0
  }, {
    "code": OK,
    "current_limit": {
      "requests_per_unit": 10,
      "unit": MINUTE,
      "name": "update_requests_per_ip" << PROPOSED NEW FIELD
    },
    "limit_remaining": 5
  }]
}

[Relevant Links:]

Some examples of public APIs that have a similar concept of naming or describing which rate limit you've hit:

The AdWords API provides "rateScope" and "rateName" to clients when they hit a rate limit, which could theoretically be expressed as a name.

The FB Marketing API has an "X-Business-Use-Case" response header which provide rate limit details by account & type, which could theoretically be expressed through a name. Maybe as a human-readable or json blob with with all the information.

dweitzman added a commit to dweitzman/envoy that referenced this issue Apr 3, 2020
This part of the global rate limiter api is not currently used by envoy, but for anyone implementing the envoy global rate limiter api being able to describe what specific limit you've hit in a human-readable and/or machine-readable way will be useful for debugging, alerting, etc.

See envoyproxy#10556

Signed-off-by: David Weitzman <dweitzman@pinterest.com>
htuch pushed a commit that referenced this issue Apr 7, 2020
…10557)

This part of the global rate limiter api is not currently used by envoy, but for anyone implementing the envoy global rate limiter api being able to describe what specific limit you've hit in a human-readable and/or machine-readable way will be useful for debugging, alerting, etc.

Risk Level: Low
Testing: n/a
Docs Changes: n/a
Release Notes: n/a

Fixes #10556

Signed-off-by: David Weitzman <dweitzman@pinterest.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants