feat(quotas): add has_usage_quota interface method for usage-based categories#106393
feat(quotas): add has_usage_quota interface method for usage-based categories#106393
Conversation
…tegories Add a new quota checking method for categories with TallyType.USAGE. This is distinct from has_available_reserved_budget which is for cost-based Reserved Budgets (where reserved=-2). The method checks if an organization has available quota for usage-based categories like SIZE_ANALYSIS, INSTALLABLE_BUILD, and similar categories that are not rate-limited in Relay. Default implementation returns True; actual logic is in getsentry. BIL-1980
There was a problem hiding this comment.
This quota interface keeps getting extended and already has a bunch of methods which are no longer true to the original intention (Relay enforced quotas).
Obviously not a new thing, it's just another method and which happens to also call out Relay. But it may be a good starting point to start thinking about separating the interfaces.
Wdyt?
|
We can move these out to a new class (e.g. Does having these new methods in |
No, all is good, just thinking a bit about architecture. If the growth of methods was intentional, that's fine too. Please feel free to just move ahead with this PR, this discussion is probably better held outside that PR anyways.
Why do you need that to subclass Quota? |
|
Yea I agree. We've been adding billing based methods to I'll look into re-organizing this better. |
Closes https://linear.app/getsentry/issue/BIL-1980/quota-method-for-emerge
Add a new quota checking method for categories with TallyType.USAGE. This is distinct from has_available_reserved_budget which is for cost-based Reserved Budgets (where reserved=-2).
The method checks if an organization has available quota for usage-based categories like SIZE_ANALYSIS, INSTALLABLE_BUILD, and similar categories that are not rate-limited in Relay.
Default implementation returns True; actual logic is in getsentry.