posthog icon indicating copy to clipboard operation
posthog copied to clipboard

feat: add billing rate limiter to plugin server

Open kappa90 opened this issue 2 years ago • 2 comments

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

kappa90 avatar Dec 30 '22 12:12 kappa90

Also this should definitely get a review from the pipeline team as this path is quite sensitive to any increase in delays

benjackwhite avatar Jan 03 '23 08:01 benjackwhite

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.

posthog-bot avatar Jan 13 '23 07:01 posthog-bot

This PR was closed due to lack of activity. Feel free to reopen if it's still relevant.

posthog-bot avatar Jan 20 '23 07:01 posthog-bot

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.

posthog-bot avatar Jan 30 '23 07:01 posthog-bot

We can close this one as @benjackwhite has been working on a different approach

kappa90 avatar Jan 30 '23 08:01 kappa90