posthog
posthog copied to clipboard
chore(cdp): add tests for quota limiting
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