Repository navigation
feat: add captureAi on the capture V1 AI endpoint #939
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
042b7bf
feat: add captureAi on the capture V1 AI endpoint
turnipdabeets 3d8bec7
feat: cap AI queue disk use and return the event UUID from captureAi
turnipdabeets af822d8
fix: flush and bound AI queue reads by batch bytes, and flush it on c…
turnipdabeets d384209
chore: return success from the compliance adapter's /capture_ai
turnipdabeets 27ec307
feat(queue): cap analytics batches at 5 MiB
turnipdabeets 800e920
feat: give AI requests a 60 s timeout and log non-$ai_ captureAi names
turnipdabeets a0a729c
docs: note the 5 MiB analytics batch cap in the migration guide
turnipdabeets cf6c2ae
docs: add an AI events section to the migration guide
turnipdabeets a58da3c
feat: add captureAi settings to PostHogConfig
turnipdabeets ee92eab
fix: make captureAiMaxEventBytes limit the whole serialized event
turnipdabeets 8ac03d0
feat!: remove the /batch fallback from capture V1
turnipdabeets a35f65c
chore: stop ignoring /batch in replay network capture
turnipdabeets 9c7b166
docs: drop the /batch fallback from the migration guide
turnipdabeets 65b2cc3
fix: keep ignoring /batch in replay network capture
turnipdabeets 3479164
docs: list the reverse proxy requirements for capture v1
turnipdabeets 949225e
test(compliance): disable AI compression when enable_compression is f…
turnipdabeets b6c4c91
fix: log capture V1 drop reasons and the captureAiMaxEventBytes clamp
turnipdabeets 5a584cb
docs: note the captureAiMaxEventBytes clamp warning
turnipdabeets eb60169
Merge remote-tracking branch 'origin/feat/v4-capture-ai' into feat/v4…
turnipdabeets 9881b2e
Merge branch 'feat/v4-capture-v1' into feat/v4-capture-ai
turnipdabeets File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| --- | ||
| 'posthog-ios': minor | ||
| --- | ||
|
|
||
| Add `captureAi(...)` to send AI events such as `$ai_generation` to PostHog's AI endpoint (`/i/v1/ai/events`), which accepts events up to 8 MiB. It returns the event UUID. | ||
|
|
||
| Analytics batches are now also capped at 5 MiB per request, so a batch of large events stays under capture V1's request limit; an event larger than that is sent on its own. | ||
|
|
||
| AI requests time out after 60 seconds without network activity, instead of 10, since they can carry several MB. | ||
|
|
||
| Add `captureAiCompression`, `captureAiMaxQueueSize`, `captureAiTimeout` and `captureAiMaxEventBytes` to `PostHogConfig` to tune AI requests separately from other events. The defaults keep the behavior above: gzip, 100 queued events, 60 seconds and 8 MiB plus 64 KiB per serialized event. | ||
|
|
||
| With `debug` on, the SDK logs the name, UUID and reason of each event PostHog drops, and warns when `captureAiMaxEventBytes` is set above its 8 MiB plus 64 KiB ceiling, which it uses instead. | ||
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 4.0 guide has no section for
captureAiyet. Can this PR add one covering the AI endpoint, the 8 MiB event limit, the 60-second timeout and the new 5 MiB analytics batch cap? How wrapper SDKs such as Flutter expose AI capture is still being worked out for all of them at once, so for now the guide can describe only the native iOS API.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added in 5880463