Rate limit application monitoring best practice

Hi,

I am currently developing an almost real-time rate limit monitoring dashboard, and I was wondering what was the best practice to use.

To my understanding and with the documentation, rate-limits are reset every minute at a specific second (X-Rate-Limit-Reset). However, to make my tool more accurate, I need the max rate limit used in 1 minute.

Currently, I have 2 solutions, one is to wait until the last second before making a call to the endpoint and fetch the rate-limit-remaining from the header. One problem with that, is that i need to make 2 requests (one to get the rate-limit-reset, and another for the “max” rate-limit-remaining), and wait the the rate-limit-reset.

The second one is to make 1 API call, and make an extrapolation for the “max” rate-limit-remaining in that minute.

Both of these methods have their own drawbacks, and i was wondering if you had any other solution i could use.

Thanks!

Hi there. Did you end up developing a solution? Is it something you can share? thanks!

The rate limits are pretty much static (and published) so I think you would just grab them from there.

@chu123 - we know the static values… the intent is to monitor consumption of rate limit over time.

For instance, query /authn every 15 seconds and store the responses header value for X-Rate-Limit-Remaining, then measure/analyze that number over time.