Rate limiting config feature idea

Rate limiting idea that popped into my head tonight:

Right now say I rate limit by consumer @ say 500 TPS and enable it once globally.

Well say you have 100’s of proxies, and you don’t want to have to enable the rate limit plugin 1 by 1 on each proxy per a given consumer to limit their rate. BUT you also don’t want to tie a user down to barebones 500 TPS total on the gateway, but rather a generic limit for all consumers that have access to a given route/service on Kong?

I am thinking what if we added a config option that lets you rate limit by consumer globally with another dropdown

config.limit_by_route_or_service: “route” / “service” / “none”(default behavior) could be the options in the list array. Then when they rate limit lookup key gets stored it can be include the route id or service id and the consumer and thats the value that gets incremented. I think this would give the global rate limit better flexibility so you are not just limiting the consumer to X amount of TPS on the gateway, but rather limiting consumer by X amount per given “proxy” essentially without having to bloat your kong with tons of specific rate limit plugin instances. Does that kinda make sense?

I might review the code and PR this functionality as I think it could def be useful.

-Jeremy