ci: add public API snapshot check#1
Closed
marandaneto wants to merge 8 commits into
Closed
Conversation
…662) * feat(exception-capture): add client-side token bucket rate limiting Port the posthog-js BucketedRateLimiter (packages/core/src/utils/ bucketed-rate-limiter.ts) and apply it to exception autocapture with the same settings as the browser and Node SDKs: one bucket per exception type, bucket size 10, refilling 1 token per 10 seconds. Resolves the long-standing TODO in exception_capture.py. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * feat(exception-capture): make rate limiting configurable Expose exception_autocapture_bucket_size, exception_autocapture_refill_rate and exception_autocapture_refill_interval_seconds on Client and the module-level API, passed through to ExceptionCapture's rate limiter. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * feat(exception-capture): raise default rate limits for server workloads Bucket size 50 refilling 10 tokens per 10 seconds (was 10/1/10, the browser SDK defaults) since one server process aggregates exceptions across many users' requests. Defaults now live on ExceptionCapture and are referenced by Client and the module-level API. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * feat(exception-capture): make rate limiting opt-in Add enable_exception_autocapture_rate_limiting (default False) on Client, the module-level API and ExceptionCapture. The limiter is only constructed when enabled, so default behavior is unchanged from released versions. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(exception-capture): key rate limiter on root cause of chained exceptions PostHog groups exceptions by $exception_list[0].type, which is the root cause (exceptions_from_error_tuple reverses the walked chain), not the wrapping exception. Walk the chain so e.g. `RuntimeError from ZeroDivisionError` is keyed on ZeroDivisionError, matching server-side grouping and posthog-js. Also move the ExceptionCapture integration tests out of test_bucketed_rate_limiter.py into test_exception_capture.py so each file covers a single unit. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* fix: add missing return type annotations * chore: add changeset for missing return type annotations --------- Co-authored-by: Manoel Aranda Neto <marandaneto@gmail.com>
* docs: centralize SDK examples in official docs * address pr review feedback * restore fastapi playground usage docs * restore python support table in readme * update readme framework doc links
Author
|
Closing this because it was opened against the wrong base repository. Correct PR: PostHog#667 |
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.
💡 Motivation and Context
Add a generated public API snapshot check so CI can catch accidental changes to the SDK's exported public surface. The snapshot can be regenerated intentionally with
make public_api_snapshot.💚 How did you test it?
uv run --extra dev python .github/scripts/check_public_api.py --checkuv run --extra dev ruff check .github/scripts/check_public_api.pyuv run --extra dev ruff format --check .github/scripts/check_public_api.py📝 Checklist
If releasing new changes
sampo addto generate a changeset file