-
Notifications
You must be signed in to change notification settings - Fork 125
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: allow config of before_send function to edit or reject events #1515
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Size Change: +10.4 kB (+0.33%) Total Size: 3.12 MB
ℹ️ View Unchanged
|
have updated and tested the examples in the posthog.com docs PR and tested this locally i think this is good to go |
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.
left a few comments but I don't have strong opinion about them so LGTM
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.
Non-blocking and has been covered by others but:
- I would probably allow the footgun and let people do any event, and make a customization to only touch safe events. That way the list of safe events can be outside of the default bundle and keep the size down
- I agree with @marandaneto that sampling should be 0-1 rather than 0-100, just because I'd expect this from using other dev tools e.g. Sentry.
- It'd be cool if we provided a way to chain these functions easily :)
@robbie-c how about allowing an array of functions... then we can do
|
Makes sense, would you multiply the sample thresholds together? |
see RFC: https://github.com/PostHog/product-internal/pull/668/
see docs PR: PostHog/posthog.com#9844
The number of config options to redact urls or edit properties is growing
It is simpler to have a single hook where you can edit an event before it is captured
This also allows the enterprising customer configure a sampling function
tested locally and event capture still works without a beforeSend set
and e.g. the pre-canned event sampling function works as expected