Skip to content

Ingestion pipeline refactor and onEvent/onAction breaking changes #9737

@yakkomajuri

Description

@yakkomajuri

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 set
  • now, sent_at will be removed
  • offset and kafka_offset will be removed
  • site_url will be removed
  • properties will be a different shape than in processEvent - 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, and site_url usage
  • Make this clear in Docs and release notes

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions