-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Motivation
We're approaching a spot where we want to do some event-level processing separately from the main pipeline. Either due to buffering, separating ingestion and async jobs, so onEvent/onAction load doesn't affect main process, consuming from CH, name it.
Problem
We currently expose the PluginEvent interface to plugins everywhere - for onEvent
, onAction
functions specifically. However internally we don't have access to it once we do the split.
Solution
Minor breaking changes to the payload onEvent
& onAction
& onSnapshot
receive.
These changes are:
timestamp
will be always setnow
,sent_at
will be removedoffset
andkafka_offset
will be removedsite_url
will be removedproperties
will be a different shape than inprocessEvent
- we add/overwrite in case of conflicts some properties. Some examples of changes:- group_X properties for group analytics
- $set, $set_once is always set
- Initial utm properties are set
With this, the explicit user contract becomes:
processEvent
will receive raw event payloads (no change)
onEvent
will receive the same event payload as we store in our database (instead of a "third" type in between the raw payload and the final event)
Next steps
- @yakkomajuri to map out
now
,sent_at
, andsite_url
usage - Make this clear in Docs and release notes