Skip to content

feat(posthog-rs): add historical batch capture support#69

Merged
z0br0wn merged 5 commits intomainfrom
zbrown/posthog-rs-historical-batch-support
Feb 23, 2026
Merged

feat(posthog-rs): add historical batch capture support#69
z0br0wn merged 5 commits intomainfrom
zbrown/posthog-rs-historical-batch-support

Conversation

@z0br0wn
Copy link
Copy Markdown
Contributor

@z0br0wn z0br0wn commented Feb 17, 2026

this is change 2 of 3 for updating posthog-rs to be able to support the batch import worker.

the current capture batch function hits the main capture endpoint - this endpoint however doesn't support the historical migration flag. this adds a new function to use both the batch endpoint and migration flag (i could have also changed the existing capture batch function to hit that endpoint, but wasn't sure if there was any context / assumptions that would break by doing so).

@z0br0wn z0br0wn requested a review from a team February 17, 2026 16:53
@z0br0wn z0br0wn force-pushed the zbrown/posthog-rs-historical-batch-support branch from a498bc8 to 34d98cd Compare February 17, 2026 17:07
/// Capture a collection of events as a historical migration. Events are sent
/// to the `/batch/` endpoint and routed to the historical ingestion topic,
/// bypassing the main ingestion pipeline.
pub async fn capture_batch_historical(&self, events: Vec<Event>) -> Result<(), Error> {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

For the time being, we can submit batches to the default capture endpoint the SDK is configured to use; all of them accept batches or single-event payloads right now

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@eli-r-ph i still need to update this to just have all capture batch calls go to the batch endpoint - but i was (maybe wrongly) under the impression that the default capture endpoint doesn't support the historical migration flag, whereas the batch endpoint does!

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All endpoints support the historical flag - in fact, almost all of them are handled identically in the backend 👍

@z0br0wn z0br0wn force-pushed the zbrown/posthog-rs-error-handling branch from 9aab9ea to fc25abf Compare February 19, 2026 01:27
@z0br0wn z0br0wn force-pushed the zbrown/posthog-rs-historical-batch-support branch from 677de80 to a07f88c Compare February 19, 2026 01:39
Base automatically changed from zbrown/posthog-rs-error-handling to main February 23, 2026 19:50
@z0br0wn z0br0wn force-pushed the zbrown/posthog-rs-historical-batch-support branch from b4640fd to 7884c1e Compare February 23, 2026 19:58
@z0br0wn z0br0wn merged commit d94ecbb into main Feb 23, 2026
8 checks passed
@z0br0wn z0br0wn deleted the zbrown/posthog-rs-historical-batch-support branch February 23, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants