From 052d3c1b226589be6722b2ba1a1b15a90f53e074 Mon Sep 17 00:00:00 2001 From: Florent Chehab Date: Fri, 24 Jul 2026 10:04:33 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(summary)=20report=20exception=20type?= =?UTF-8?q?=20in=20failure=20analytics?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We know capture also the exception type that was raised in failure analytics to provide more insights about what happened. --- CHANGELOG.md | 6 ++++++ src/summary/summary/core/analytics.py | 5 ++++- src/summary/summary/core/celery_worker.py | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f586118a..e1793da3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,9 +8,15 @@ and this project adheres to ## [Unreleased] +### Added + +- ✨(summary) report exception type in failure analytics + ## Fixed - 🐛(transcription) fix silent bug in speaker assignment +- 🐛(summary) extend tasks auto retry logic +- 🐛(summary) properly detect when failure webhook should be sent ### Changed diff --git a/src/summary/summary/core/analytics.py b/src/summary/summary/core/analytics.py index 2fbcff88..c1a9391e 100644 --- a/src/summary/summary/core/analytics.py +++ b/src/summary/summary/core/analytics.py @@ -202,13 +202,16 @@ class MetadataManager: }, ) - def capture(self, task_id, event_name): + def capture(self, task_id, event_name, extra_properties=None): """Capture analytics event with task metadata and clean up.""" if self._is_disabled or not self.has_task_id(task_id): return metadata = self._get_metadata(task_id) + if extra_properties: + metadata = {**metadata, **extra_properties} + if "start_time" in metadata: metadata["execution_time"] = round(time.time() - metadata["start_time"], 2) del metadata["start_time"] diff --git a/src/summary/summary/core/celery_worker.py b/src/summary/summary/core/celery_worker.py index d491a286..e12e17ca 100644 --- a/src/summary/summary/core/celery_worker.py +++ b/src/summary/summary/core/celery_worker.py @@ -612,6 +612,7 @@ def handle_transcribe_v2_failed( metadata_manager.capture( task_id, settings.posthog_transcript_failure, + {"exception_type": type(exception).__name__}, ) call_webhook_v2_task.apply_async( args=[ @@ -720,6 +721,7 @@ def handle_summarize_v2_failed( metadata_manager.capture( task_id, settings.posthog_summary_failure, + {"exception_type": type(exception).__name__}, ) call_webhook_v2_task.apply_async( args=[