feat(capture v1): v1 analytics event implements SInk event serialization contract#53808
feat(capture v1): v1 analytics event implements SInk event serialization contract#53808eli-r-ph wants to merge 3 commits intoeli.r/capture-v1-sinks-5from
Conversation
|
| // (e.g. `drop_partition_key: bool`) is needed for the | ||
| // `Limited + !preserve_locality` case that drops key WITHOUT | ||
| // setting the person processing header. | ||
| if self.force_disable_person_processing |
There was a problem hiding this comment.
Left a TODO here but I think we have the plumbing to handle this already in v1 at this point, will follow up on this after this PR stack is landed
| // remapping, IP redaction, property merging. Tackled separately. | ||
| unimplemented!("WrappedEvent::serialize_into") | ||
| fn serialize_into(&self, ctx: &Context, buf: &mut String) -> Result<(), String> { | ||
| let ingestion_data = self.build_ingestion_data()?; |
There was a problem hiding this comment.
Got convinced by Claude early on to return String instead of a dedicated error type here but I hate it already, it's silly. Will update now or in next PR
Problem
Stacked PR, based on this parent PR (5th in Sinks series.) Implements the new
v1::sinks::Eventserialization contract for the v1 analytics event types (request'sv1::Context,v1::analytics::WrappedEventand friends) to produce the newv1::analytics::IngestionEventwhich is in parity with legacyCapturedEventshape for ingestion backend compatibility, as verified by the new test suite.This step includes some DIY
event.propertiessurgery:At this stage, to avoid changing the downstream schema contract, we're injecting (with legacy prop renames!) the new
v1::analytics::Event'sevent.optionprops, if present, into the legacyevent.propertiesmap as ingestion workers expect. This is a bit hacky but well tested, and shouldn't cause trouble at this step. The incoming v1 events are well validated by this step.This PR includes a couple of other loose ends this unit of work surfaced:
WrappedEventChanges
CapturedEventHow did you test this code?
Locally and in CI. Integration test suite coming in a follow on after this series lands (too big to include here)
👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Publish to changelog?
N/A
Docs update
N/A