-
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
Releasing session recording EPIC #1846
Comments
A couple quick points from me:
|
I'd be in favour of using a similar system that we use for feature flags to decide who gets recorded, ie either filtering or a percentage of users. However I don't think this is blocking a soft release. On the data side, there's three quick things we can do
I think the minimum todos for a soft release are
|
Agreed re reducing the data by cutting properties - it will cut the data need by 30-50%, which is significant. |
2 and 3 - currently we don't have a working plugin system with scheduled jobs. We'll have it by the end of the week, but not yet. I can take into account whatever is needed. For sure I want it to have some access to call PH API commands so we could have plugins that insert events. If that will be via the HTTP API or via Regarding sessions, I've been thinking for a while that having a dedicated This would make all session queries faster, provide a convenient way to group events and enable deterministic session recording URLs. This would solve issue #6 as well. In fact, I could implement this as a plugin that stores this on a property, though official support as a field in the events table might be a better choice. Point nr x: If you browse a site as a logged in user from both your phone and your computer (different user agents), it should show up as two separate sessions. |
Related to issue PostHog/posthog#1846 This also introduces given2 as a testing util to simplify some of the testing.
On the topic of UX, I was thinking something along these lines (feel free to challenge):
On self-hosted On cloud Cohorts |
Thanks @paolodamico, this is great input and I like the design! Some considerations:
Here's my current plan (updated after plugins epic/experience from last week):
Note the order may change. |
Session recording is now out! Note that it requires updating any npm-based posthog.js installations to >= 1.5.2 or 1.6.0 There is a bunch of things to do - I've created a whole host of issues and tagged them with session recording. Feel free to share any and all feedback in issues. |
This issue aggregates work to be done for releasing #149 (session recording) to our users or to be done after the release.
Current plan
Note the order may change.
Older notes
To do before release
1. Data capture enabling logic
Users:
Other products have solved this problem by:
@jamesefhawkins I believe you had input here?
Own thoughts:
2. Data storage, retention logic
Currently we're storing the events as $snapshot events in posthog_event table, piggybacking a lot of the logic of posthog.js/api.
I did a bit of measurement on the data. The average $snapshot event weighs (for app.posthog.com) 1.7kb. Regular posthog.js web events on our domain are 1.07kb. Raw data available on demand ;)
Compared to normal events, we'll be capturing ~10x the data for session recordings on app.posthog.com than normally.
Due to this, it seems sensible to set up data retention limits.
Proposal: Create a autoinstalled posthog plugin which in a cronjob removes sessions recording older than $N days in pg/clickhouse. Default $N to 7.
Depends on plugin support getting merged.
cc @fuziontech - Does the above approach seem reasonable? I'd prefer to continue using events table due to being able to piggy-back a lot of our infra.
3. Storing session data on S3
The above-mentioned plugin could also have an optional config value S3_URL, where it will save "old" recordings.
Proposed naming:
session_recording/v1/{distinct_id}/{timestamp}.json
We'd also need to store links to these inside posthog db - @fuziontech / @mariusandra can plugins use ph models?
4. Creating persistent/sharable URLs
To make session recording useful, recordings should be linkable - this way they can be shared within development or product teams as something interesting is discovered.
Proposal:
/sessions/{distinct_id}/{timestamp}/recording
shows the player5. posthog.js session recording improvements
Status: Done
Currently posthog.js:
This can lead to missing several seconds every pageload.
Proposed approach:
6. Sessions page performance, events page readability
With session recording turned on, the sessions page has become slow due to the amount of data being loaded.
This can be fixed by not loading/showing $snapshot events by default on that page.
Related note from @Twixes (https://posthog.slack.com/archives/C0113360FFV/p1602674096139100)
7. Cypress specs, posthog.js specs, documentation
After release
X. Improving player UX
There is a lot of metadata we could expose about the session: e.g. urls, locations, window sizes and more.
In addition, we should persist user settings in the player (speed, skip inactive).
We could also make it start the next session once the current one finishes - combined with #1835 or being able to jump from funnel => people who converted/dropped out it would make for an interesting experience.
@mariusandra I believe you had input here?
X. Make sure SVG-s are loaded properly
We have seen that graphs on posthog.js do not (yet) load correctly - investigate.
X. Minimizing network traffic in posthog.js
Currently, $snapshot events are sent along with normal events every time 5 snapshots have been triggered. This causes a lot of unnecessary network requests and we could do additional batching within our recording code to minimize this.
The text was updated successfully, but these errors were encountered: