feat(posthog-rs): add historical batch capture support#69
Merged
Conversation
a498bc8 to
34d98cd
Compare
eli-r-ph
reviewed
Feb 17, 2026
src/client/async_client.rs
Outdated
| /// 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> { |
There was a problem hiding this comment.
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
Contributor
Author
There was a problem hiding this comment.
@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!
There was a problem hiding this comment.
All endpoints support the historical flag - in fact, almost all of them are handled identically in the backend 👍
eli-r-ph
approved these changes
Feb 17, 2026
9aab9ea to
fc25abf
Compare
677de80 to
a07f88c
Compare
b4640fd to
7884c1e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).