-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
chore: improve the logging for quote limiting #28063
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR improves logging and error tracking for PostHog's quota limiting system by standardizing event names and adding Sentry integration for better observability.
- Added Sentry error capturing in
tasks.py
to track failures inupdate_quota_limiting
task - Consolidated quota limiting events under single event name
org_quota_limited_until
with event type property inquota_limiting.py
- Added exception tracking for missing team tokens and usage data with standardized event properties
- Updated test assertions in
test_quota_limiting.py
to match new logging format - Improved logging for
update_all_orgs_billing_quotas
with consistent event naming and properties
3 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -177,8 +178,9 @@ def org_quota_limited_until( | |||
if organization.never_drop_data or trust_score == 15: | |||
report_organization_action( | |||
organization, | |||
"quota limiting ignored", | |||
"org_quota_limited_until", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: we might want to rename to something generic since in some of these cases we are not rate limiting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't want to touch report_organization_action because those have been around for a while but yeah once I fix the underlying issue I'm going to revisit the core events here.
Changes
Building on: #27936
No functionality changes
👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Does this work well for both Cloud and self-hosted?
How did you test this code?
Updated tests