Summary
Organisations on a 1M / 30-day plan are receiving "API use has reached 90%" and later ">100%" usage notification emails while their actual usage (usage page + Django admin) is well below the limit (~130k-190k of 1,000,000). Usage tracking itself is correct. Only the alert/notification percentage math is wrong.
Observed
- Usage page and Django admin show ~130k-190k API calls for the period against a 1,000,000 plan limit.
- Notification emails still fired 90%, then 100%+, over consecutive days.
- No overage or service impact actually occurred.
Suspected cause (to validate)
The usage notification task appears to evaluate usage against the cached "Organisation subscription information cache" value rather than the actual plan limit. When that cache is stale or incorrect (holding a lower allowed-call figure than the real plan), the percentage is computed against the wrong denominator and trips the alert thresholds. Needs validation against handle_api_usage_notifications.
Steps to reproduce
- Find an org whose Organisation subscription information cache holds an allowed-API-call value lower than the org's actual plan limit.
- Ensure real usage exceeds that cached (wrong) value but is below the true plan limit.
- Allow the usage notification task to run.
- Observe 90%/100% alert emails fire despite real usage being well under the plan.
Notes
Summary
Organisations on a 1M / 30-day plan are receiving "API use has reached 90%" and later ">100%" usage notification emails while their actual usage (usage page + Django admin) is well below the limit (~130k-190k of 1,000,000). Usage tracking itself is correct. Only the alert/notification percentage math is wrong.
Observed
Suspected cause (to validate)
The usage notification task appears to evaluate usage against the cached "Organisation subscription information cache" value rather than the actual plan limit. When that cache is stale or incorrect (holding a lower allowed-call figure than the real plan), the percentage is computed against the wrong denominator and trips the alert thresholds. Needs validation against
handle_api_usage_notifications.Steps to reproduce
Notes