posthog icon indicating copy to clipboard operation
posthog copied to clipboard

feat: Added recording metrics to system status

Open benjackwhite opened this issue 2 years ago • 3 comments

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
Screenshot 2023-01-12 at 09 14 48

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

How did you test this code?

benjackwhite avatar Jan 12 '23 08:01 benjackwhite

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?

benjackwhite avatar Jan 12 '23 09:01 benjackwhite

Would you feel comfortable only appending these metrics only on self-hosted?

macobo avatar Jan 12 '23 16:01 macobo

Would you feel comfortable only appending these metrics only on self-hosted?

Ah ha thats a great middle ground!

benjackwhite avatar Jan 13 '23 09:01 benjackwhite