-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Send a weekly instance status report (resolves #1509) #1683
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.
This looks like a great start! Added a few comments, but feel free to adjust what you think makes the most sense. We might also be better off shipping an initial version and iterating from there.
posthog/celery.py
Outdated
@@ -48,6 +47,9 @@ def setup_periodic_tasks(sender, **kwargs): | |||
sender.add_periodic_task( | |||
crontab(day_of_week="mon,fri"), update_event_partitions.s(), # check twice a week | |||
) | |||
sender.add_periodic_task( | |||
10, status_report.s(), |
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.
This would send the report every 10 seconds, perhaps a cron schedule here? Also, what should we do with retries or if the server is down during the scheduled time (e.g. Heroku free dynos). Ideally we would also have a failsafe on PostHog side to prevent duplicate entries for the same week.
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.
Related to the above, we might have the edge case of a user having multiple instances or workers, so event duplication prevention might become more relevant (doing reports on a team-basis would also help here).
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.
Ah, sorry, this is a leftover from testing, supposed to be crontab(day_of_week="mon")
. :)
A-ha, there is one odd issue: |
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.
Looking good! As a final thing maybe we should add a test for the status_report() method?
Changes
This adds a weekly (sent to us each Monday) status report regarding each PostHog instance as a whole, including event ingestion metadata.