Skip to content
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: configure session recording sample rate #18068

Merged
merged 42 commits into from
Oct 24, 2023

Conversation

pauldambra
Copy link
Member

@pauldambra pauldambra commented Oct 18, 2023

We want to allow

  • sampling of session recordings
  • starting recording only when a flag is active
  • not sending recordings below a minimum duration

This

  • adds the settings to the team
  • updates the UI for changing replay settings (behind a flag)
  • and adds the settings to the decide response

This pairs nicely with PostHog/posthog-js#839

Screenshot 2023-10-23 at 11 52 36
Screenshot 2023-10-23 at 11 52 42
Screenshot 2023-10-23 at 11 52 52
Screenshot 2023-10-23 at 11 53 10

posthog/api/team.py Outdated Show resolved Hide resolved
groupType: TaxonomicFilterGroupType.FeatureFlags,
value: value,
onChange: (_, __, item) => {
'id' in item && item.id && onChange(item.id, item.key)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liyiy @neilkakkar I've moved the flag selector into components since I wanted to use it in replay config. And exposed the flag key as well as the id on change... That ok?

Copy link
Contributor

@benjackwhite benjackwhite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small points but no show stoppers

/>
</div>
<p>
Setting a minimum session duration will ensure that only sessions that last longer than that
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should warn that this does mean some useful data may not be collected. Debugging a user issue that starts with a loading screen before redirecting to another domain. With this setting set to say, 10 seconds, the initial redirect screen would not have been recorded as it is only buffered in memory.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could also be expanded in documentation instead of the modal

@pauldambra pauldambra merged commit 74d4d37 into master Oct 24, 2023
71 checks passed
@pauldambra pauldambra deleted the feat/configure-session-recording-sample-rate branch October 24, 2023 17:34
Justicea83 pushed a commit to Justicea83/posthog that referenced this pull request Oct 24, 2023
* feat: configure session recording sample rate

* fix mock

* Update query snapshots

* Update query snapshots

* Update query snapshots

* fix

* fix

* Update query snapshots

* fix

* fix

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Fix

* fix

* fix

* add minimum duration setting

* dropdown instead of text box

* start adding linked flag

* fix

* fix

* Update query snapshots

* Update query snapshots

* Update query snapshots

* Update query snapshots

* only return flag key in decide

* doh

* fix

* Fix

* don't have a restricted list of sample rates

* fix

* fix

* Update query snapshots

* all the options

* review changes

* Fix

* fix

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants