🔧(backend) make PostHog event names configurable for transcript tracking
Add setting to customize PostHog event names when tracking transcript results for flexible analytics configuration.
This commit is contained in:
committed by
aleb_the_flash
parent
cbabcb877b
commit
93e3f05348
@@ -148,7 +148,7 @@ def task_retry_handler(request=None, reason=None, einfo=None, **kwargs):
|
||||
@signals.task_failure.connect
|
||||
def task_failure_handler(task_id, exception=None, **kwargs):
|
||||
"""Signal handler called when task execution fails permanently."""
|
||||
tasks_tracker.capture(task_id, "task_failed")
|
||||
tasks_tracker.capture(task_id, settings.posthog_event_failure)
|
||||
|
||||
|
||||
@celery.task(max_retries=settings.celery_max_retries)
|
||||
@@ -329,6 +329,6 @@ def process_audio_transcribe_summarize_v2(
|
||||
logger.info("Webhook submitted successfully. Status: %s", response.status_code)
|
||||
logger.debug("Response body: %s", response.text)
|
||||
|
||||
tasks_tracker.capture(task_id, "task_succeeded")
|
||||
tasks_tracker.capture(task_id, settings.posthog_event_success)
|
||||
|
||||
# TODO - integrate summarize the transcript and create a new document.
|
||||
|
||||
@@ -53,6 +53,8 @@ class Settings(BaseSettings):
|
||||
posthog_enabled: bool = False
|
||||
posthog_api_key: Optional[str] = None
|
||||
posthog_api_host: Optional[str] = "https://eu.i.posthog.com"
|
||||
posthog_event_failure: str = "transcript-failure"
|
||||
posthog_event_success: str = "transcript-success"
|
||||
|
||||
# TaskTracker
|
||||
task_tracker_redis_url: str = "redis://redis/0"
|
||||
|
||||
Reference in New Issue
Block a user