-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
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.