feat: Added recording metrics to system status
Problem
Some customers are requesting to see how many recordings they have used, the same as they see event metrics in instance status. Whilst we are waiting for more visibility at the Billing level, this is an easy add.
Changes
- Adds the recording count for month to date and the count of individual events to the instance status page
👉 Stay up-to-date with PostHog coding conventions for a smoother review.
How did you test this code?
Problem: both of these queries result in reading all of the session recordings from disk.
These are expensive queries that take up significant resources. Without page cache ($$$), the distinct count takes ~20 seconds currently and streams a lot of data between shards.
I can be convinced that this is neccessary but this will likely make the system status page unusable and drain unneccessary clickhouse resources. I might sound like a broken record, but we should really just fix the session recordings schema...
Interesting... We do basically the same thing for Usage reports on a daily basis (although I think only for 1 day instead of 30).
The target is self-hosted customers being able to answer the question of "how many recordings am I using", partly to help them understand the cost of swapping to cloud / upgrading to a paid plan. Feels like thats worth the trade-off given we only run it on the instance status page?
Would you feel comfortable only appending these metrics only on self-hosted?
Would you feel comfortable only appending these metrics only on self-hosted?
Ah ha thats a great middle ground!