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

Proposal: Add WithinLimit Counter to RateLimitStats #230

Open
jterryhao opened this issue Feb 25, 2021 · 4 comments
Open

Proposal: Add WithinLimit Counter to RateLimitStats #230

jterryhao opened this issue Feb 25, 2021 · 4 comments

Comments

@jterryhao
Copy link
Contributor

Hi team, I'm wondering if we can add a counter that counts the number of requests that is within limit (not over limit).

The reason is that we need to keep track how many requests are allowed by the rate limit service per second. We have some rate limits that don't allow any traffic and we want to monitor and make sure that no requests are going through. We are currently calculating it using
rate(total_hits) - rate(over_limit)

So for rate limits with 0 as the limit, this query should always return 0; however, prometheus' (we export the stastd metrics to prometheus) rate function does some smoothing/extrapolation and we often get non-zero numbers for those rate limits.

If we can add the WithinLimit counter, we can use that directly for monitoring allowed per second. Any help is appreciated. Thanks!

@mattklein123
Copy link
Member

Sure that sounds reasonable to me.

@zufardhiyaulhaq
Copy link
Contributor

zufardhiyaulhaq commented Feb 28, 2021

I can take this one after the rolling window limit PR #193 is merged if you do not mind.

@jterryhao
Copy link
Contributor Author

If you don't mind, I can also take this one if @zufardhiyaulhaq is busy with the rolling window limit PR (feels like a large one)

@lmajercak-wish
Copy link
Contributor

Can we close this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants