posthog icon indicating copy to clipboard operation
posthog copied to clipboard

chore(cdp): add tests for quota limiting

Open meikelmosby opened this issue 1 month ago • 0 comments

Problem

Quota limit checks for CDP had no error handling, which could cause metric discrepancies between Grafana and ClickHouse. When Redis was unavailable or the quota check failed, the entire async function would throw, leading to:

  • potentially Grafana counters not being incremented
  • Invocations still being processed and billed

We want to fail-open here.

Changes

Added try-catch error handling around the quota limit check. When the check fails:

  • Log the error
  • Capture exception
  • Continue processing
  • Tests added to verify failure handling

How did you test this code?

  • added tests

meikelmosby avatar Dec 10 '25 13:12 meikelmosby