posthog
posthog copied to clipboard
feat: add billing rate limiter to plugin server
Problem
We want to rate limit organizations that are above their billing limit.
Changes
Introduce a RateLimiter
that checks if an organization_id is stored in either an event limited or session recording limited set of ids in Redis.
For now, we just log the rate limiting to statsd
, we don't drop anything.
@benjackwhite the way you had created the rate limiter using promises didn't work so I simplified it, let me know if you think something is fishy
How did you test this code?
Added tests for the rate limiter
Also this should definitely get a review from the pipeline team as this path is quite sensitive to any increase in delays
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale
label – otherwise this will be closed in another week.
This PR was closed due to lack of activity. Feel free to reopen if it's still relevant.
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale
label – otherwise this will be closed in another week.
We can close this one as @benjackwhite has been working on a different approach