Skip to content

ci: add public API snapshot check#1

Closed
marandaneto wants to merge 8 commits into
Kshitijmishradev:mainfrom
PostHog:ci/add-public-api-snapshot-check
Closed

ci: add public API snapshot check#1
marandaneto wants to merge 8 commits into
Kshitijmishradev:mainfrom
PostHog:ci/add-public-api-snapshot-check

Conversation

@marandaneto

Copy link
Copy Markdown

💡 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 --check
  • uv run --extra dev ruff check .github/scripts/check_public_api.py
  • uv run --extra dev ruff format --check .github/scripts/check_public_api.py

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

If releasing new changes

  • Ran sampo add to generate a changeset file

hpouillot and others added 8 commits June 15, 2026 11:56
…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
@marandaneto

Copy link
Copy Markdown
Author

Closing this because it was opened against the wrong base repository. Correct PR: PostHog#667

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants