-
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
feat: Add LLM integration usage to organization reports #24757
Conversation
I'm really sorry but I'm nervous about this being 4 extra big queries across the events table. I will look tomorrow to see if I can do a rollup. If not I will merge this and hope it's okay. |
@raquelmsmith with the help of ChatGPT I managed to combine it into a single query. Let me know if this looks better! |
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.
Nice work with this! Thank you for taking it on 🙏 One suggestion for clarity, one question, and the type annotation should be fixed. but otherwise looks great 🙌
@Lior539 can you fix the code quality check failures? |
@raquelmsmith fixed the code quality checks :) |
Problem
We want to know which companies are using our LLM integrations in PostHog. Currently, there's no way to do this
Changes
Add the following fields to the organization_usage_report
Does this work well for both Cloud and self-hosted?
No impact
How did you test this code?
Added tests + ran
pytest posthog/tasks/test/test_usage_report.py