feat: emit usage_concurrent_call_limit_reached PostHog event

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Abhishek Kumar 2026-07-09 17:39:21 +05:30
parent 6f977cf6d9
commit 6a48207999
5 changed files with 63 additions and 2 deletions

View file

@ -7,6 +7,12 @@ from api.constants import POSTHOG_API_KEY, POSTHOG_HOST
_posthog_client: Posthog | None = None
POSTHOG_SERVER_GROUP_IDENTIFY_DISTINCT_ID = "server-group-identify"
POSTHOG_ORGANIZATION_GROUP_TYPE = "organization"
# Stable distinct_id for server-originated events with no acting user.
# Group-linked events must stay identified (setting $process_person_profile
# to False would unlink them from the organization group), so a single shared
# "server" person absorbs them instead of minting one person per org.
POSTHOG_SERVER_EVENT_DISTINCT_ID = "server"
def get_posthog() -> Posthog | None: